?
Solved

Creating a pop up

Posted on 2005-04-06
5
Medium Priority
?
228 Views
Last Modified: 2013-11-28
Hi folks,
I was looking for help from someone to tell me how to do a pop up window for my site.
When someone clicks on a web page, ie info page, a pop up window will appear and it will allow them to sign up to a mailing list.
How do I do this? I used the code from a pop up generator software but when I tested it out, it wouldnt pop up!
Where does the code go?

All the best,
Kwaoc
0
Comment
Question by:kwaoc
  • 3
5 Comments
 
LVL 1

Accepted Solution

by:
taydui earned 500 total points
ID: 13723798
You can use fowlling code and change name linktoPopuphere.html to your signup page.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body onclick="MM_openBrWindow('linktoPopuphere.html','signup','width=200,height=200')">
</body>
</html>
0
 
LVL 1

Author Comment

by:kwaoc
ID: 13724516
If someone signs up for the newsletter, will this pop up still keep coming up on their pc when they visit my site again?
0
 
LVL 1

Expert Comment

by:taydui
ID: 13724526
 In that case, you have to use cookies to mark if that user signed up your newsletter or not.
0
 
LVL 5

Expert Comment

by:jericotolentino
ID: 13724831
Hi,

Here's a script you can use to make a window popup only once. It's from the SimplyTheBest website.

You can adjust it according to your needs.

-------------

<SCRIPT LANGUAGE="JavaScript">
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!-- Begin

var expDays = 1; // number of days the cookie should last
var page = "signup.htm";
var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
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" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);
window.open(page, "", windowprops);
}
else {
count++;
SetCookie('count', count, exp);
}
}
// End -->
</script>


<body onLoad= "checkCount()" bgcolor="#99CC99" link="#003565" vlink="#003565" alink="#003565" leftmargin="0" topmargin="0">
0
 
LVL 1

Expert Comment

by:taydui
ID: 13724844
 Yes, it is ok.  Kwaoc,you can use it.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is a massive demand for content on the web right now, and it doesn't look like it's going to stop any time soon. But, if you are running a business blog, it's not just enough to offer your audience lots of content. It needs to be high-quality…
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question