ssskaya
01-17-2004, 03:57 PM
If I have the .js script for openup as an external file (instead of inserting it b/w </head> and <body>), how will I have to replace:
<a href="javascript:openup('http://www.newsite.com/','new')">Link</a>
Thanks.
Antoniohawk
01-17-2004, 07:20 PM
Shouldn't what you have there work. As long as the openup() function is correct in your external file, you should have no problem with what you are currently using.
ssskaya
01-17-2004, 08:24 PM
I understand.
But how am I going to refer to the external file?
scroots
01-17-2004, 10:37 PM
ssskaya can we see your function.
Do you mean how can you access the window that the website is opened up in?
scroots
ssskaya
01-18-2004, 02:07 AM
well,.. what I mean is:
I have the external .js file that has the openup script.
As for the .html page, in which I will insert the openup command, I believe what I have above will not be enough since it does not have anything that refers to the external file.
For example, if it was an external date script called date.js, I would refer to it with a script like: <script src="www.mywebsite.com/date.js"></script>
This script would show the path to the external file.
How about this openup function?
glenngv
01-19-2004, 09:14 AM
As you said, you need to refer to the .js file in your html pages.
<head>
<script type="text/javascript" src="pathToJSfile.js"></script>
</head>
And then you can call any method or global variables in that js in your html pages.
Just make sure the .js file does not contain <script></script> tags.
ssskaya
01-19-2004, 08:04 PM
great!
this was what I was looking for.
thanks!