Your HostICan Community  


Go Back   Your HostICan Community > Programming & Design > Javascript / Java Applets

Javascript / Java Applets Are you a JavaScript guy? Do you need help with JavaScript? This is the place to talk about anything related to Java.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-11-2009, 12:51 PM
v1rkit v1rkit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 3
Default popup

Hi all, I want to create a pop-up for one of my pages. Can someone give me an easy code that can be used. Please also explain me where in my source page code should I put your new code.

Best Regards
Reply With Quote
  #2  
Old 04-11-2009, 01:16 PM
hood's Avatar
hood hood is offline
Senior Member
 
Join Date: Jan 2009
Posts: 107
Default Re: popup

Set up the code is very easy. Choose from what file you want to show popup window and put the code in it. You must put this code after HEAD
HTML Code:
<SCRIPT TYPE="text/javascript">
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=800,height=600,scrollbars=yes');
return false;
}
</SCRIPT> 
Then this code is placed after BODY
HTML Code:
<BODY onLoad="popup('autopopup.html', 'ad')"> 
Reply With Quote
  #3  
Old 04-11-2009, 03:01 PM
Shazam's Avatar
Shazam Shazam is offline
Forum Whip-Cracker
 
Join Date: Sep 2007
Location: Scottsdale, AZ
Posts: 1,023
Default Re: popup

Quote:
Originally Posted by hood View Post
Set up the code is very easy. Choose from what file you want to show popup window and put the code in it. You must put this code after HEAD
HTML Code:
<SCRIPT TYPE="text/javascript">
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=800,height=600,scrollbars=yes');
return false;
}
</SCRIPT> 
Then this code is placed after BODY
HTML Code:
<BODY onLoad="popup('autopopup.html', 'ad')"> 
But remember that most browsers turn off pop-up windows by default.
__________________
Best,
Shazam
HostICan Community Superhero
Reply With Quote
Reply

Tags
popup

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On

Forum Jump


All times are GMT -4. The time now is 09:55 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Copyright © 2003 - 2008 HostICan. All Rights Reserved.