Jump to content

Variable Link in JavaScripts


kareem_elzeiny

Recommended Posts

Well after correcting this error ,, another error appear
Error: str is undefinedSource File: http://sharingacademy.blogspot.com/?link=http://www.w3schools.com/jsref/prop_loc_pathname.asp&Line: 440

and it's not even related to the non working script !!!

right. as JSG pointed out it's because of link. I've asked you couple times if you were using the location object to get that, like we discussed about at the beginning of the thread. Well, there where other problems to solve first, but it was eventually going to come to this point. So now you need to go back and define link by getting the file name through the location object. (I provided a link in one of my posts.)
Link to comment
Share on other sites

Thank you,, there were two variables called linkI've rename the second one and the two alerts now are loaded but I'm working now to solve a new error :/

Error: dsCounter is not definedSource File: http://sharingacademy.blogspot.com/?link=http://google.com&Line: 505

Link to comment
Share on other sites

when calling this scripthttp://dstats.net/dstatsjs.php?file=http://google.comIt should calling information about the link "google.com" & the info changes by changing the urland dsCounter is a part of this EXTERNAL scriptand this other script will show the info called

<script type='text/javascript'> document.write(dsCounter+'x');</script>

If I call the this script directly

<script type='text/javascript' src='http://dstats.net/dstatsjs.php?file=http://google.com'></script>

The second script works with no errors but If I called it using the variable passing depending script ,, nothing happens

Link to comment
Share on other sites

Your loaded function isn't doing anything with the script element you've created. You should append it to the head or to somewhere in the body above where you're trying to write the value. Since you're not waiting for the script to load before trying to write the value out you might also need to add a delay before it tries to write it to the page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...