View Full Version : Help requested

06-02-2004, 01:49 AM
Hello js pros of all ages and sizes!
I have a question for you and any help would be appreciated.

I have a webpage (these are examples only):
and on that page are several clickable links that open js windows with content.
javascript:jsOpenWnd (372,'widgetname','widgetname2')

Is there a way I can make a link from another page, eg:
http://www.widgetname2.com/widget.php that will go to the javascript window content from the first page?

PS: The page I want to link from is a different website. So I want to link from www.whackywidgetsite.com/page1.html to the other site's webpage and have the javascript window on the other website open automatically without having to re-direct the user to the page first and then make them look for the appropriate js link.

I don't want the link to have to go back to the first page and then have the user click on a link just to open the js window, can I combine the two into one link?

Any help would be appreciated and if this request isn't too clear then, well...you should see my desk! :eek:


06-02-2004, 05:15 PM
make the javascript part a js file and then pass it as
*script language="Javascript" src="whatever.js"*

06-02-2004, 09:27 PM
Thanks FJ!

I'm not sure exactly what you mean though could you maybe elaborate a bit?

If I'm on Page1 of Site1 and I want a link on that page to open a window that is a js window on Page2 of Site2 how would I work the code you suggested?

Thanks for the help!


06-06-2004, 02:30 PM
a js file is just a javascript file or simply put the javascript itself above your "head" statement in your html page.
Definitely look for a quick tutorial on it, it WILL be quick, don't sweat it.

It's pretty much just
document.write{ pasted script with all quotes changed to apostrophes}
so you'd just copy and paste the script in, change the " to ' and then snip it from the original page. Save that file as whatever.js then upload whatever.js to your server.
On any page from then on, if you want to use that script you just type in that *script language="Javascript" src="whatever.js"* line I mentioned.
Now this is gonna be a tiny file.
If you're doing it on site 2, due to site permissions, you might not be able to change the above src=http://www.siteone.com/whatever.js" and "call it" from the first site. If not, no worries, just upload this small file to the site 2 server.
One tip, if you plan to do this alot. Create a directory named "Scripts" or "JavaClass" or "Java" or somesuch. Then when you're filling out that src=whatever.js you know exactly where they are. Like how folks do with image tags(img src) and directories(Pics, Images, Pictures directory names).

Again, very easy. Do NOT sweat a quick tutorial on js files. Hit google or webmonkey or dynamicdrive or whatever and search for "js file". Maybe post the link here so others can use it. Lemme know how you make out.