Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
JavaScript Pop-Up help?????
Old 05-23-2004, 08:29 PM JavaScript Pop-Up help?????
Unknown.

Posts: 1,693
Trades: 0
Ive tryed setting up a pop-up which is launched by clicking a link, using the following code:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=250');");
}
// End -->
</script>

Then seting the link to:

<A HREF="javascript: popUp('www.dark-skys.com')">Open the Popup Window</A>

It works when i tested it on a blank file, but when i insert it into the body of the file i want to use it in it just does nothing, I dunno if its because ive set up an external file (home.js) for the javascripts, even though other javascripts work when inserted into the body of the document along with the external file. Even when ive tryed inserting it into the external file it still doesn't work???

So is their any way i can get it to work without having to scrap to external file and insterting the javascripts back into the body????

Thanks in advance
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-23-2004, 09:37 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
Well, you should be able to just put it into a js file then call it.
If I have misunderstood your post sorry But below is what I suggest.

Take this
------------------

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=250');");
}


-----------------
Save as home.js

Then put this code in your website (best to put it in your head but doesn't really matter)

<SCRIPT LANGUAGE="JavaScript" src="home.js">
</script>

In order for this to work the home.js will need to be in the same directory as the html file.
__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 05-23-2004, 11:32 PM
gastong's Avatar
Super Talker

Posts: 123
Location: Argentina
Trades: 0
The script works ok for me.

btw: remember to add http:// before the url
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
gastong is offline
Reply With Quote
View Public Profile Visit gastong's homepage!
 
Old 05-24-2004, 11:52 AM
Unknown.

Posts: 1,693
Trades: 0
Managed to get it working from the js file when putting it in a blank file but still not on the page i'll just have to start the page again and see if i can tell what i did wrong

Thanks
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to JavaScript Pop-Up help?????
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45026 seconds with 12 queries