<HTML>
<HEAD>
<TITLE>The JavaScript Source: Code Generators: Popup Window Maker</TITLE>
<META HTTP-EQUIV="The JavaScript Source" CONTENT="no-cache">
<META NAME="description" CONTENT="Don't worry any more about editing the code by hand, use our code generator! Fill out the specifications of the popup window you would like to use, including the URL and the various options such as menubars, toolbars, scrollbars, etc, and click the generate button. Just add this generated code to your site, or even have us mail it to you! Neat!">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var email = GetCookie('email_address');
if (email == null) {
email = 'your email here';
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;}
return null;}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = ".internet.com";
// (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");}
function checkCodeMail() {
invalid = ""
email = document.mail.user.value;
code = document.mail.source.value;
if (code == "") {
invalid += "Before you can send your code to yourself you need to ";
invalid += "follow the instructions above to output the code. When "
invalid += "the code has been generated, click \"Done\" to email it!\r\n\r\n";}
if (email.indexOf("@")<1 || email == "your email here" || email == "") {
invalid += "Invalid email address! Be sure that in your email address ";
invalid += "you included your Username, the '@' Sign, and the Domain Name.";}
if (invalid == "") {
doAd();
return true;
}
else {
alert(invalid);
return false;}}
function doAd() {
pathname = location.pathname;
myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000));
SetCookie('email_address',email,largeExpDate,myDomain);
page = "http://javascript.internet.com/sent.html?" + email;
window.open(page, "AdWindow", "width=515,height=150");
return true;}
function uncode() {
smut="<";
replacewords="< ";
txt=document.mail.source2.value;
tstx="";
space=replacewords.indexOf(" ");
wrd=replacewords.substring(0,space);
wrdl=wrd.length
replacewords=replacewords.substring(space+1,replacewords.length);
while (txt.indexOf(wrd)>-1){
space=txt.indexOf(wrd);
txt=txt.substring(0,space)+smut+txt.substring((space+wrdl),txt.length);}
smut=">";
replacewords="> ";
space=replacewords.indexOf(" ");
wrd=replacewords.substring(0,space);
wrdl=wrd.length
replacewords=replacewords.substring(space+1,replacewords.length);
while (txt.indexOf(wrd)>-1){
space=txt.indexOf(wrd);
txt=txt.substring(0,space)+smut+txt.substring((space+wrdl),txt.length);}
document.mail.source2.value=txt;}
// End -->
</script>
<!-- Now it's time for the *REAL* code generator to begin.... -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function generate(form){
page = document.inputForm.page.value;
toolbars = document.inputForm.toolbars.checked;
scrollprops = document.inputForm.scrollit.checked;
locations = document.inputForm.locations.checked;
statusbars = document.inputForm.statusbars.checked;
menubars = document.inputForm.menubars.checked;
resizeable = document.inputForm.resizeable.checked;
width = document.inputForm.width.value;
if (!width) width = screen.width;
height = document.inputForm.height.value;
if (!height) height = screen.height;
howto = document.inputForm.howtoopen.options[document.inputForm.howtoopen.selectedIndex].value;
center = document.inputForm.center.checked;
start = "<";
if(howto == 'body') {
otherOutput = start + "!-- STEP TWO: Paste this onLoad event handler into the BODY tag -->\n\n" + start + "BODY onLoad=\"javascript:popUp()\">";
}
if(howto == 'link') {
otherOutput = start + "!-- STEP TWO: Use the following link to open the new window -->\n\n" + start + "A HREF=\"javascript:popUp()\">Open the Popup Window" + start + "/A>";
}
if(howto == 'button') {
otherOutput = start + "!-- STEP TWO: Use the following button code for the new window -->\n\n" + start + "form>\n" + start + "input type=button value=\"Open the Popup Window\" onClick=\"javascript:popUp()\">\n" + start + "/form>";
}
scriptOutput = start + '!-- TWO STEPS TO INSTALL POPUP WINDOW:\r\n\r\n'
+ ' 1. Paste the first into the HEAD of your HTML document\r\n'
+ ' 2. Use the code to open the popup page on your site -->\r\n\r\n'
+ '<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->\r\n\r\n'
+ '<HEAD>\r\n\r\n' + start + 'SCRIPT LANGUAGE="JavaScript">\r\n'
+ '<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->\r\n'
+ '<!-- Web URL: http://fineline.xs.mw -->\r\n\r\n'
+ '<!-- This script and many more are available free online at -->\r\n'
+ '<!-- The JavaScript Source!! http://javascript.internet.com -->\r\n\r\n'
+ '<!-- Begin\r\n'
+ 'function pop' + 'Up() {\n';
scriptOutput += "props=window.open('" + page + "', 'poppage', '" +
((toolbars) ? "toolbars=1, " : "toolbars=0, ") +
((scrollprops) ? "scrollbars=1, " : "scrollbars=0, ") +
((locations) ? "location=1, " : "location=0, ") +
((statusbars) ? "statusbars=1, " : "statusbars=0, ") +
((menubars) ? "menubars=1, " : "menubars=0, ") +
((resizeable) ? "resizable=1" : "resizable=0") +
((width) ? ", width=" + width : "") +
((height) ? ", height=" + height : "") +
((center) ? ", left = " + ((screen.width - width) / 2) : "") +
((center) ? ", top = " + ((screen.height - height) / 2) : "") +
"');\n}\n// End -->\n" + start + "/sc" + "ript>\n";
output = scriptOutput + "\n\n" + otherOutput + '\n\n' + start +'!-- Script Size: 0.73 KB --'+'>';
document.mail.source.value = output;
document.mail.source2.value = output;
uncode();
}
// End -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#ffffff vlink=#0000ff>
<P>
<center>
<!-- AdSpace site=internetcom&size=468x60&PagePos=220&channel=_CHANNEL_&content_site=_SITE_&feature=_FEATURE_ -->
<a target="_top" href="/event.ng/Type=click&ProfileID=1&RunID=3491&AdID=3037&TagValues=140.194.208.222.250.572.579.619.915&FamilyID=553&GroupID=1&Redirect=http://www.hsx.com/cgi-bin/redirect.cgi%3fO=INTCshwus&L=/o2k/special/party.shtml"><img src="/ads/2000/01/showus468x60.gif" border=0 height=60 width=468 alt=""></a>
<!-- /AdSpace -->
<P>
<BR>
<BR>
<BASEFONT SIZE=3>
<FONT SIZE=6>
<B><FONT SIZE="+2" FACE="Helvetica,Arial" ALIGN=RIGHT COLOR="#0000FF">
<b><A HREF="http://javascript.internet.com" TARGET="_top">
Home</A> </b><img src="http://javascript.internet.com/img/arrow.gif" height=13 width=7 border=0 alt="}"> <b><A HREF="./" TARGET="_top"><font color="#FF0000">Generators</font></A> </b>
<img src="http://javascript.internet.com/img/arrow.gif" height=13 width=7 border=0 alt="}"> <FONT COLOR="#006666">Popup Window Maker</FONT></b></FONT><BR>
</B><BR>
</FONT>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>
<br>
<!-- Description -->
Don't worry any more about editing the code by hand, use our code generator! Fill out the specifications of the popup window you would like to use, including the URL and the various options such as menubars, toolbars, scrollbars, etc, and click the generate button. Just add this generated code to your site, or even have us mail it to you! Neat!
<br>
<hr>
</td></tr>
</table>
<!-- Demonstration -->
<center>
<form name=inputForm>
<table width=500 cellpadding=2 cellspacing=0 border=1>
<tr>
<td>
<table cellpadding=8 cellspacing=2 border=1>
<tr>
<td colspan=2>This machine will make a script that will pop up and optionally center the popup window for you. Fill in the values below and click Make Code.</td>
</tr>
<tr>
<td width="400">What filename should be opened?</td>
<td><input type=text name=page size=10><br>(filename or http://....)</td>
</tr>
<tr>
<td>Would you like it to have toolbars?</td>
<td><input type=checkbox name=toolbars></td>
</tr>
<tr>
<td>Would you like the window to have scrollbars?</td>
<td><input type=checkbox name=scrollit></td>
</tr>
<tr>
<td>Would you like it to have the location bar?</td>
<td><input type=checkbox name=locations></td>
</tr>
<tr>
<td>Would you like it to have a status bar?</td>
<td><input type=checkbox name=statusbars></td>
</tr>
<tr>
<td>Would you like it to have a menu bar?</td>
<td><input type=checkbox name=menubars></td>
</tr>
<tr>
<td>Would you like it to be resizeable?</td>
<td><input type=checkbox name=resizeable></td>
</tr>
<tr>
<td>How wide would you like it to be?</td>
<td><input type=text name=width size=4> (in pixels)</td>
</tr>
<tr>
<td>How high would you like it to be?</td>
<td><input type=text name=height size=4> (in pixels)</td>
</tr>
<tr>
<td>How should the window be opened?</td>
<td><select name=howtoopen>
<option value="button">by a button
<option value="link">by a link
<option value="body">automatically
</select>
</td>
</tr>
<tr>
<td>Should we center the window on screen?</td>
<td><input type=checkbox name=center></td>
</tr>
<tr>
<td colspan=2><center><input type=button value="Make Code!" onClick="javascript:generate();"></center></td>
</tr>
</table>
</td></tr>
</table>
</form>
<p>
<center>
<form name="mail" action="/cgi-bin/code-mail.cgi" method="POST" onSubmit="return checkCodeMail()">
<input type=hidden name=scriptname value="Popup Window Maker">
<table bgcolor="dedfdf" border="2" cellpadding="4" width=400>
<tr><td align=center><textarea name="source" rows=12 cols=80></textarea><br>
<input type=hidden name="source2"><br>
<font size="2" face="arial">"Cut and Paste" the code above, or....</font><br><br>
<table cellpadding=20 cellspacing=0 border=1>
<tr bgcolor=#ebebeb><td align=center><tt>We'll send your generated code to you!<p></tt>
<SCRIPT>
<!-- Begin
document.write('<input type=text size=25 name=user value="'+email+'" onfocus=\"select()\">');
// End -->
</SCRIPT>
<NOSCRIPT>
<input type=text size=25 name=email value="your email here">
</NOSCRIPT>
<input type=submit value="Send it!"><p><font size="-2">(just click "Send it!" once!)</font>
</td>
</tr>
</table></td><p></tr>
</table>
</form>
</center>
<!-- AdSpace site=internetcom&size=468x60&PagePos=230&channel=_CHANNEL_&content_site=_SITE_&feature=_FEATURE_ -->
<a target="_top" href="/event.ng/Type=click&ProfileID=499&RunID=3416&AdID=2864&TagValues=140.194.208.222.250.572.579.619.915&FamilyID=443&GroupID=7&Redirect=http://www.lotus.com/developertraining"><img src="/ads/2000/01/468se12cjan.gif" border=0 height=60 width=468 alt="Lotus Online Seminars. The latest on Lotus without leaving your seat."></a>
<!-- /AdSpace -->
<P><P>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var email = GetCookie('email_address');
if (email == null) { // || (email = undefined))
email = 'your email here';
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = "/"; //(argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
// End -->
</SCRIPT>
<script language="JavaScript">
<!-- Begin
function chk(email)
{
invalid = "";
if (!email)
invalid = "No email address found! Please re-enter your email address and submit again.";
else {
if ( (email.indexOf("@") == -1) || (email.indexOf(".") == -1) )
invalid += "\n\nInvalid email address. Your email address is missing an '@' sign and a '.' in the domain name (like '.com'). Please check your address then submit again.";
if (email.indexOf("youremailhere") > -1)
invalid += "\n\nInvalid email address. Make sure your email address included your username, the '@' sign, and the domain name (like '.com').";
if (email.indexOf("\\") > -1)
invalid += "\n\nEmail address contains an invalid back-slash (\\) character. Remove the character and submit again.";
if (email.indexOf("/") > -1)
invalid += "\n\nEmail address contains an invalid forward-slash (/) character. Remove the character and submit again.";
if (email.indexOf("'") > -1)
invalid += "\n\nEmail address contains an invalid apostrophe (') character. Remove the character and submit again.";
if (email.indexOf("!") > -1)
invalid += "\n\nEmail address contains an invalid exclamation point (!) character. Remove the character or correct the email address then submit again.";
if ( (email.indexOf(",") > -1) || (email.indexOf(";") > -1) )
invalid += "\n\nPlease only enter one email address in the box at a time. Remove the extra addresses and submit again.";
if (email.indexOf("?subject") > -1)
invalid += "\n\nPlease do not add '?subject=...' to your email address. Scriptbot will send you the script with a pre-defined subject already. Please remove the '?subject=...' from your email address and submit again.";
if ( (email.indexOf("à") > -1) || (email.indexOf("á") > -1) || (email.indexOf("ä") > -1) || (email.indexOf("è") > -1) || (email.indexOf("é") > -1) || (email.indexOf("ë") > -1) || (email.indexOf("ì") > -1) || (email.indexOf("í") > -1) || (email.indexOf("ï") > -1) || (email.indexOf("ñ") > -1) || (email.indexOf("ò") > -1) || (email.indexOf("ó") > -1) || (email.indexOf("ö") > -1) || (email.indexOf("ù") > -1) || (email.indexOf("ú") > -1) || (email.indexOf("ü") > -1) || (email.indexOf("ý") > -1) || (email.indexOf("ÿ") > -1) )
invalid += "\n\nAccented characters (like è) are not accepted. Please enter its unaccented character instead then submit again.";
}
if (invalid == "")
{
var largeExpDate = new Date();
largeExpDate.setTime(largeExpDate.getTime() + (31 * 24 * 3600 * 1000));
SetCookie('email_address', email, largeExpDate);
return true;
}
else
{
alert("Oops, something is wrong...." + invalid);
return false;
}
}
// End -->
</script>
<P>
<CENTER>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
<TR>
<TD ALIGN=CENTER>
<BR>
<FORM ACTION="http://e-newsletters.internet.com/cgi-bin/newslinx.form" METHOD=POST NAME=jsform TARGET="_blank" onSubmit="return chk(document.jsform.Email_Address.value)">
<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR="#ffffcc">
<TR><TD ALIGN=center VALIGN=middle>
<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 BGCOLOR="#ffffcc">
<TR><TD COLSPAN=3 ALIGN=center VALIGN=bottom>
<FONT FACE="arial, helvetica" SIZE="-1"><a href="http://e-newsletters.internet.com/javascriptsource.html">Sign up for the JavaScript Source's Newsletters!</A></FONT>
</TD></TR>
<TR>
<TD WIDTH=150 ALIGN=CENTER VALIGN=MIDDLE>
<TABLE>
<TR><TD><INPUT TYPE=radio NAME="List_Name" VALUE="JAVASCRIPTSOURCE-UPDATE" checked></TD>
<TD><FONT FACE="arial, helvetica" size="-1">Site Updates!</FONT></TD></TR>
<TR><TD><INPUT TYPE=radio NAME="List_Name" VALUE="JAVASCRIPTSOURCE-NEWS"></TD>
<TD><FONT FACE="arial, helvetica" SIZE="-1">Monthly Digest</FONT></TD></TR>
</TABLE>
</TD>
<TD ALIGN=CENTER VALIGN=MIDDLE><FONT FACE="arial, helvetica" size="-1"><CENTER>Your Email:<br>
<SCRIPT>
<!-- Begin
document.write('<input type=text size=12 maxlength=50 name="Email_Address" value="'+email+'" onfocus=\"this.value=\'\'\">');
// End -->
</SCRIPT>
<noscript>
<input type=text size=12 maxlength=50 name="Email_Address" value="your email here">
</noscript>
</CENTER></FONT></TD>
<TD ALIGN=CENTER VALIGN=MIDDLE><CENTER>
<INPUT TYPE="submit" NAME="Submit" VALUE="Subscribe">
</CENTER></TD></TR>
</TABLE>
<INPUT TYPE=hidden NAME="Name_OPT" VALUE="Anonymous">
<INPUT TYPE=hidden NAME="Action" VALUE="subscribe">
<INPUT TYPE=hidden NAME="type" VALUE="TEXT">
<INPUT TYPE=hidden NAME="LAST" VALUE="THE_END">
</TD></TR></TABLE>
</FORM>
</TD>
<TD ALIGN=right><FONT FACE="arial" size="-2"><DIV ALIGN=right><SPAN CLASS="address">
[ <A HREF="http://javascript.internet.com/feedback.html" ONMOUSEOVER="window.status='Comments, questions, suggestions, or gripes, we want to hear from you!'; return true" ONMOUSEOUT="window.status=''; return true">Contact Us!</A> ]<BR>
[ <A HREF="http://forum.javascriptsource.com" ONMOUSEOVER="window.status='Visit our JavaScript Forum for assistance!'; return true" ONMOUSEOUT="window.status=' '; return true">JavaScript Forum</A> ]<P>
The JavaScript Source<P>
Copyright 2000 <A HREF="http://www.internet.com/">Internet.com Corp.</A><BR>
All Rights Reserved. <A HREF="http://www.internet.com/corporate/legal.html">Legal Notices</A><P>
<A HREF="http://www.internet.com/corporate/privacy/privacypolicy.html">Privacy Information</A><BR>
<A HREF="http://javascript.internet.com/advertising.html">Advertising Information</A><P>
</SPAN></DIV></FONT></TD>
</TR></TABLE></CENTER>
Top of Form 1
This machine will make a script that will pop up and optionally center the popup window for you. Fill in the values below and click Make Code. |
|
What filename should be opened? |
|
Would you like it to have toolbars? |
|
Would you like the window to have scrollbars? |
|
Would you like it to have the location bar? |
|
Would you like it to have a status bar? |
|
Would you like it to have a menu bar? |
|
Would you like it to be resizeable? |
|
How wide would you like it to be? |
(in pixels) |
How high would you like it to be? |
(in pixels) |
How should the window be opened? |
|
Should we center the window on screen? |
|
|
|
We'll send your generated code to you!
(just click "Send it!" once!) |
<!-- TWO STEPS TO INSTALL POPUP WINDOW: 1. Paste the first into the HEAD of your HTML document 2. Use the code to open the popup page on your site --><!-- STEP ONE: Copy this code into the HEAD of your HTML document --><HEAD><SCRIPT LANGUAGE="JavaScript"><!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) --><!-- Web URL: http://fineline.xs.mw --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com --><!-- Beginfunction popUp() {props=window.open('http://www.geocities.com/cmanjarr/links.html', 'poppage', 'toolbars=1, scrollbars=1, location=1, statusbars=1, menubars=1, resizable=0, width=500, height=500');}// End --></script><!-- STEP TWO: Use the following button code for the new window --><form><input type=button value="Open the Popup Window" onClick="javascript:popUp()"></form><!-- Script Size: 0.73 KB -->