Click to See Complete Forum and Search --> : Call external .js from internal function.


bobpinz
06-28-2003, 04:55 PM
Hello,
Would someone kindly tell me the correct format to call an external javascript .js file from inside an internal javascript function. I am trying:
<script>
function pu() {
src="/xxx.js";
}
</script>
I want to run the file xxx.js but I don't want the code to be in my webpage as a function. This code has no errors but doesn't do anything. This does work though:
<script src="/xxx.js"></script>
in place of the function, but I can't use it because of restrictions placed by Google.
Thanks a lot,
bob:confused:

David Harrison
06-28-2003, 05:25 PM
I'm just wondering, what restrictions? Is there a rule that says you can't use <script type="text/javascript" src="xxx.js"></script>

Or does it clash with one of their scripts, or does it just edit it out of your source? :confused:

bobpinz
06-28-2003, 05:49 PM
Hello

Since that code runs when your HTML page loads, Google picks it up and rejects the page because that page generates a 'popunder.' I'd really like that code <script src="/xxx.js"></script> to run when you 'onmouseover' a cell in a table, i.e. <td onmouseover="src=/xxx.js";></td> THIS CODE DOESN'T WORK, thus delaying the popunder until the client actually moves their mouse over a cell. Google won't pick this up I don't think. I'm looking for the right code to somehow launch that external .js file.

Thanks,
Bob