[Javascript] js file soemtimes not executing

Peter Brunone peter at brunone.com
Wed Dec 1 10:42:01 CST 2004


Hi Jessica,
 
    This seems like a really contorted way of doing things.  Why not
just assign the script source right away?
 
    If you need to do it this way, I'd suggest putting both calls in the
same attribute, i.e. either the onclick event handler or the href
property, like this:
 
<a id="btn" onclick="srcLd();
BringUpBigWindow('ButtonClick.aspx?brand=quotea&amp;referrer=');"
href="">
 
or
 
<a id="btn"
href="JavaScript:srcLd();BringUpBigWindow('ButtonClick.aspx?brand=quotea
&amp;referrer=')">
 
Let us know if any of that works (apologies if you get an error; I'm in
a hurry and I haven't tested these).
 
Cheers,
 
Peter Brunone
______________
EasyListBox.com

 -----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Jessica


 

Hi,

 

Hope u can assist me in my problem that needs to be resolved asap.

 

On button click I call the following :

 

<script type="text/javascript"> 

function srcLd()

{

var scr_tg=document.getElementById('scr2');

scr_tg.src="Ninja.js";

} 

</script>

 

<a id="btn" onclick="srcLd()"
href="JavaScript:BringUpBigWindow('ButtonClick.aspx?brand=quotea&amp;ref
errer=')">

<img src="" alt="car test" name="test" width="105" height="95"

                                      border="0"></a>

<script id="scr2" type="text/javascript" src="">;</script>

 

All Ninja.js has is just an alert statement. This is a really strange
but sometimes on button click I get the alert statement and sometimes
not.

Can u see what the problem is, I even deleted the item from the cache.

 

Thankyou in advance

jessica

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20041201/fd958253/attachment.htm>


More information about the Javascript mailing list