[SPAM] - RE: [Javascript] js file soemtimes not executing - Email found in subject

Jessica Jessica at greenlight.co.uk
Wed Dec 1 10:59:40 CST 2004


Hi Peter,

 

Thankyou I have tried your method and it sort of works but not very
consistent. I clicked on the button a few times and did not get the
alert statement. So Im not so sure.

 

The only reason I am doing this is because I need to track a button
click. The following <a> tag is on the client side.

All I did was ask him to add srcLd()........then in srcLd, my js file is
executed and writes to the database if the button is clicked.

 

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

                             <img src="" alt="test" name="test"
width="105" height="95" border="0"> </a>

 

If the <script type="text/javascript" src="Ninja.js"></script> is on the
page then it tracks on entry to the page and not on button click, that
is the reason why I have done it like that.

 

Do u think there is caching that need to be cleared or something?

 

Thanks

jess

 

________________________________

From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Peter Brunone
Sent: 01 December 2004 16:42
To: '[JavaScript List]'
Subject: [SPAM] - RE: [Javascript] js file soemtimes not executing -
Email found in subject

 

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/f9c1eb13/attachment.htm>


More information about the Javascript mailing list