PDA

View Full Version : one prob solved one found


simu
25.04.2002, 13:15
hi all,

I finally fixed the problem Mozilla had with my page (www.endlessx.com).

But I still have a problem with NN6.1+, it seems that the js-file I dynamicly add in my behaviour.js-file doesn't even get opened.

here's the code:

<pre id=code><font face=courier size=2 id=code>
var scr1=document.createElement( 'script' );
scr1.setAttribute( 'type' , 'text/javascript' );
scr1.setAttribute( 'src' , 'elm_creating.js' );
document.getElementsByTagName( 'body' )[ 0 ].appendChild( scr1 );
</font id=code></pre id=code>

is this a bug or what?!

or does somebody know a fix? not a hacked one if possible

Edit: thanks in advance :)

~ <font color=orange>Simon Käser</font id=orange>
~ [url:zh2jyo7igl]mailto:admin@endlessX.com[/url:zh2jyo7igl]
~ [url:zh2jyo7igl]http://www.endlessX.com[/url:zh2jyo7igl] coming soon

Edited by - simu on 25 Apr 2002 18:16:22

Sergi
25.04.2002, 13:28
surely doesnt make any difference, but you could try changing <font color=red>scr1</font id=red> into <font color=red>script</font id=red>. quite weird...

cu
<font color=green>
Sergi: [url="http://meddle.dzygn.com"][site][/url:q2f13hu90o] || [url="sergi@dhtmlcentral.com"][e][/url:q2f13hu90o]
</font id=green>

Mark
25.04.2002, 13:34
it works normal in moz0.9.9

maybe you can append the script to the head-tag?

// <font color=orange>Mark</font id=orange>

:: <font color=brown>it's about the time you can live without your mama </font id=brown>:: bomfunk mc's

simu
25.04.2002, 13:46
thanks sergi and mark,

but it doesn't solve the prob. <img src=icon_smile_sad.gif border=0 align=middle>

any other suggestions?

~ <font color=orange>Simon Käser</font id=orange>
~ [url:1sd3bbrhu8]mailto:admin@endlessX.com[/url:1sd3bbrhu8]
~ [url:1sd3bbrhu8]http://www.endlessX.com[/url:1sd3bbrhu8] coming soon

Chris
25.04.2002, 15:53
when creating the element, try putting it in capitals: SCRIPT...

other than that, i don't really know. Perhaps it's a bug with NS6.. is there a part of Netscape's site about this?? hmm.. i wonder...

<img src=icon_smile_tongue.gif border=0 align=middle>

[url="http://chrispoole.com"]Chris[/url:4k0ilc1gk0]

Icestorm
25.04.2002, 18:44
I dunno, did you try alternate ways of setting the attributes, like this?
<pre id=code><font face=courier size=2 id=code><font color=black>var scr1 = document.createElement( "script" );
scr1.type = "text/javascript";
scr1.src = "elm_creating.js";
document.getElementsByTagName( "head" )[ 0 ].appendChild( scr1 );
</font id=black></font id=code></pre id=code>

I tried this stuff recently in Moz099 and it even the onload event fired perfectly when i added it in the code above.

<font face='Verdana'>:: [url="http://13thparallel.org/"]13thparallel[/url:5y5gh8o3lg] ::</font id='Verdana'>

ttrenka
25.04.2002, 18:49
Netscape 6.1 is an early build of Mozilla, so it probably doesn't have the proper wiring when it comes to dynamically adding nodes that does some sort of loading...you might want to experiment and try to load up an image using that technique, and see if it works. If not, you have confirmation; if it does, then try adding an alert function to the onload event of the new node:

scr1.onload = function() { alert('The loaded file is ' + this.getAttribute('src')) ; }

That does work in Mozilla 0.96 and up, but probably not NN6.1. If the onload event doesn't fire, it's not loading the file, and you are SOL.

Hope that helps.

Tom Trenka
"wait a minute...I really am a Doctor <img src=icon_smile_big.gif border=0 align=middle>"