Jump to content

Works in Firefox, ERROR in IE - help!


bpops

Recommended Posts

I have submitted snippets of this code before. The site I am creating works fine in Firefox, but throws back an error in IE. Here is the url:

http://www.b-pops.com/boxartist/gc.shtml

If anyone can tell me why this doesn't work in IE, I would be extremely grateful. I've been working on this for quite a while with no success.

As you'll see, the page updates automatically in Firefox. You can change background colors, add a title, etc. IE however, gives errors that I can't track down.

Also, here is the javascript that I'm using (included in the header of that page):

[code]
// JavaScript Document

function change_bg(){

var image_url = create.background.value;
var color = create.bg_color.value;
var repeat = create.bg_repeat.value;
var position_vert = create.bg_position_vert.value;
var position_hor = create.bg_position_hor.value;

box = document.getElementById('box');
position = position_vert+' '+position_hor;

box.style.backgroundImage = 'url("'+image_url+'")';
if (color){
box.style.backgroundColor = color;
}
box.style.backgroundRepeat = repeat;
box.style.backgroundPosition = position;


}

function change_title(){

var title = document.create.title.value;
var title = title.replace('\n', '<br>');
var font_family = document.create.font_family.value;
var font_custom = document.create.font_custom.value;
var font_size = document.create.font_size.value;
var font_color = document.create.font_color.value;
var font_style = document.create.font_style.value;
var title_position_vert = document.create.title_position_vert.value;
var title_position_hor = document.create.title_position_hor.value;

main = document.getElementById('main');
if(font_family == 'custom'){
font_family = font_custom;
}

main.innerHTML = title;
if(font_color){
main.style.color = font_color;
}
main.style.fontFamily = font_family;
main.style.fontSize = font_size;
main.style.color = font_color;
main.style.fontWeight = font_style;
main.style.textAlign = title_position_hor;
main.style.verticalAlign = title_position_vert;

}

/*function change_esrb(rating){
esrb = document.getElementById('esrb');

rating = 'images/logos/'+rating;
esrb.src = rating;

}*/

function change_patch(image,patch_num){
if(image == 'custom'){
if(patch_num == 'patch_1'){
image = document.create.patch_1_custom.value;
}
if(patch_num == 'patch_2'){
image = document.create.patch_2_custom.value;
}
if(patch_num == 'patch_3'){
image = document.create.patch_3_custom.value;
}
}else{
image = 'images/logos/'+image;
}

patch_num = document.getElementById(patch_num);
patch_num.src = image;

}

function only_for(image){
image = 'images/logos/'+image;
only_img = document.getElementById('only_img');
if(document.create.only.checked){
only_img.src = image;
}else{
only_img.src = 'images/logos/blank.gif';
}

}
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.