Forum Moderators: open

Message Too Old, No Replies

Done but with errors.

         

tonynoriega

4:51 pm on Apr 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i have this javascript file called on my home page to load a flash file.

works fine, no errors.

its in a template so its called on every other page on the site. Every other page however is giving me the error "done but with errors"

syntax error: line 1 char 1


function call_menu()
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="485" height="660">\n');
document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
document.write('<param name="movie" value="file.swf" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="#FFFFFF" />\n');
document.write('<param name="wmode" value="transparent" />\n');
document.write('<embed src="file.swf" wmode="transparent" quality="high" scale="exactfit" bgcolor="#FFFFFF" width="485" height="660" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
document.write('</object>\n');

why would it do that?

whoisgregg

2:38 pm on Apr 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could be that the path to the movie being relative means that pages in other folders aren't finding the file.

If "file.swf" is in the root of your site, all you'd need to do is change the src="" and movie param value="" to be "/file.swf" and it should fix the problem. :)

If not, post back and we'll see if we can come up with something else to try. :)

rocknbil

3:14 pm on Apr 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"done but with errors"

This is specific to Internet Destroyer. Err, Exploder. Err, Explorer. Any problems in FF?

Tell me, where is this "called?"

<body onload="call_menu()">

May choke in IE.

<script type="text/javascript">
call_menu();
</script>
</body>
</html>

Putting it last in the page might help with IE.

Head of document/external JS:

window.onload=function() { call_menu(); };

will not execute until the page is fully loaded, might help.

Worth a shot, but personally, since you're committed to Javascript, you should really look at SWFObject.