Forum Moderators: open

Message Too Old, No Replies

IE Problem with JavaScript

My code works in Firefox, Safari, and Opera, but not IE

         

bsmith08

3:44 pm on Aug 22, 2008 (gmt 0)

10+ Year Member



I am trying to display a flash advertisement using JavaScript. Everything works fine in Firefox, Safari, and Opera, but when you try to view it using Internet Explorer, nothing shows up (of course). I've tried inserting the JavaScript code into the HTML, using the JavaScript code in an external file and I've taken the HTML coding out of the document.write statements and placed it into the HTML code, but that didn't work either. I was wondering if anybody could spot something that's wrong with this code:

<script type="text/javascript">
document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="250" hspace="0" vspace="0"> \n');
document.write ('<param name="movie" value="http://example.com/MR_Property_Rotation.swf');
document.write ('?clickTag=http://example.com?http://www.example.com/property.asp?id_property=121391');
document.write ('&clickTag1=http://example.com?http://www.example.com/property.asp?id_property=121391');
document.write ('&clickTag2=http://example.com?http://www.example.com/property.asp?id_property=121045');
document.write ('&clickTag3=http://example.com?http://www.example.com/property.asp?id_property=121045');
document.write ('&clickTag4=http://example.com?http://mail.yahoo.com');
document.write ('&clickTag5=http://example.com?http://www.gmail.com');
document.write ('&clickTag6=http://example.com?http://www.example.com/property.asp?id_property=108592');
document.write ('&clickTag7=http://example.com?http://www.example.com/property.asp?id_property=108592');
document.write ('&clickTag8=http://example.com?http://www.example.com/property.asp?id_property=119708');
document.write ('&clickTag9=http://example.com?http://www.example.com/property.asp?id_property=119708');
document.write ('&trackID=854');
document.write ('&baseHref=http://example.com&projectXml=http://example.com/project.xml"> \n');
document.write ('<param name="quality" value="high"> \n');
document.write ('<param name="wmode" value="transparent"> \n');
document.write ('<embed src="http://example.com/MR_Property_Rotation.swf');
document.write ('?clickTag=http://example.com?http://www.example.com/property.asp?id_property=121391');
document.write ('&clickTag1=http://example.com?http://www.example.com/property.asp?id_property=121391');
document.write ('&clickTag2=http://example.com?http://www.example.com/property.asp?id_property=121045');
document.write ('&clickTag3=http://example.com?http://www.example.com/property.asp?id_property=121045');
document.write ('&clickTag4=http://example.com?http://mail.yahoo.com');
document.write ('&clickTag5=http://example.com?http://www.gmail.com');
document.write ('&clickTag6=http://example.com?http://www.example.com/property.asp?id_property=108592');
document.write ('&clickTag7=http://example.com?http://www.example.com/property.asp?id_property=108592');
document.write ('&clickTag8=http://example.com?http://www.example.com/property.asp?id_property=119708');
document.write ('&clickTag9=http://example.com?http://www.example.com/property.asp?id_property=119708');
document.write ('&trackID=854');
document.write ('&baseHref=http://example.com&projectXml=http://example.com/project.xml" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="250" wmode="transparent">');
document.write ('\n');
document.write('</embed>');
document.write ('\n');
document.write('</object>');
document.write ('\n');
</script>

Here's a url where you can view the ad: Removed. See TOS [webmasterworld.com]

[edited by: Fotiman at 7:24 pm (utc) on Aug. 22, 2008]
[edit reason] No personal URLs please, per TOS [/edit]

Fotiman

3:01 am on Aug 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld! With regards to you question, there are libraries available that do all of the heavy lifting for you. For example, swfobject [code.google.com] is very popular and easy to use, and takes care of the cross browser issues.