Pop Ups are not working?!

  • 1
  • Problem
  • Updated 7 years ago
  • In Progress
Hi, I don't seem to be getting my Pop Ops to work.. I am using (the site) HTML Basic's Pop Up Window Code Generator and following the instructions which are not complicated. But still, my popups don't pop! Can anyone help me?
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
  • a bit frustrated because it did work the first time.

Posted 7 years ago

  • 1
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
Hi,

Are you talking about the Picture Gallery Widget? And the larger image does not pop up? Sometimes this happens if you have any kind of special character in the file name of the image. Rename it without any special characters and it should work.

Please let us know if that is not what you are talking about.
Photo of XP

XP

  • 287 Posts
  • 2 Reply Likes
Let us? How come you are Yola's champion? Or you in Yola team?
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello colinkearney,

Please can you post your URL and the page where you're having this trouble? Then, one of our forum members can take a look and see what's going on.
Photo of XP

XP

  • 287 Posts
  • 2 Reply Likes
I agree this!
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Good morning. Thank you Sanja, for your reply. I really Appreciate it.

(Hi Diane, sorry, no, I am not talking about the Picture Gallery Widget but thanks for the interest in helping.)

The page where the Pop up is located is: http://www.helpmakemoney.ca/pop-up-ex... . If it matters, when I want it to pop up is when the visitor leaves the site. Hope that helps.

I will appreciate your assistance.

For the record. I did follow the instructions which Yola gives to code in a Pop up using HTML Basic's Pop Up Window Generator which Yola recommends. It did work the first time I used it. But when I edited and re-installed the code it didn't work anymore and no matter what I try now it doesn't want to "pop". I have left the window on the navigation bar so as to find it easy while tweaking - I will remove it when things are working again.)

Colin
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Colin,

Please can you share the Pop-up code that you're trying to use? Thanks!
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
There are two pieces of code:
FIRST PIECE:

THE SECOND PIECE:
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
I did paste the code in the previous comment. Not sure why it doesn't display. It does display if I try to edit the comment. Should I post it differently?
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Hi colinrkearney

Please paste your code again. But this time, add it like this:

<!-- your code here -->

That will ensure that the code is visible on the forum post.

Thanks so much
Nazlie
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Thank you for that insight:
THE FIRST CODE IS:

<!-- <SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
<!--
var popup exit surveyWindow=null;
function popup exit survey(mypage,myname,w,h,pos,infocus){
var expHours = 1;
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() + (expHours*3600*1000));
function amt(){
var popup = GetCookie('popup')
if(popup == null) {
SetCookie('popup','1')
return 1
}
else {
var newpopup = parseInt(popup) + 1;
DeleteCookie('popup')
SetCookie('popup',newpopup,exp)
return popup
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkpopup() {
var popup = GetCookie('popup');
if (popup == null) {
popup=1;
SetCookie('popup', popup, exp);

if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';popup exit surveyWindow=window.open('',myname,settings);
if(infocus=='front'){popup exit surveyWindow.focus();popup exit surveyWindow.location=mypage;}
if(infocus=='back'){popup exit surveyWindow.blur();popup exit surveyWindow.location=mypage;popup exit surveyWindow.blur();}
}
else {
popup++;
SetCookie('popup', popup, exp);
}
}
checkpopup();
}
// -->

-->
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
THE SECOND CODE IS:

<!--

<body onLoad="popup exit survey('http://www.helpmakemoney.ca/pop-up-ex... up Exit Survey','640','480','center','front');">

-->
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
I hope it all makes sense to you ?! Because I didn't write it, nor am I a programmer.

Thanks for your assistance!
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
Thanks for posting the code colinrkearney, our HTML team will review it and get back to you.
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Hi Laura,

Thank you very much! I really do appreciate the help!
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Colinrkearney,

Thanks for your patience. I took a look at your code and see that you do not seem to have a closing script tag. Please can you try this:
<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>

var popup exit surveyWindow=null;
function popup exit survey(mypage,myname,w,h,pos,infocus){
var expHours = 1;
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() + (expHours*3600*1000));
function amt(){
var popup = GetCookie('popup')
if(popup == null) {
SetCookie('popup','1')
return 1
}
else {
var newpopup = parseInt(popup) + 1;
DeleteCookie('popup')
SetCookie('popup',newpopup,exp)
return popup
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkpopup() {
var popup = GetCookie('popup');
if (popup == null) {
popup=1;
SetCookie('popup', popup, exp);

if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';popup exit surveyWindow=window.open('',myname,settings);
if(infocus=='front'){popup exit surveyWindow.focus();popup exit surveyWindow.location=mypage;}
if(infocus=='back'){popup exit surveyWindow.blur();popup exit surveyWindow.location=mypage;popup exit surveyWindow.blur();}
}
else {
popup++;
SetCookie('popup', popup, exp);
}
}
checkpopup();
}
//
</script>


Please let me know how this goes.
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Hi Sonja,

I really really do appreciate the effort you have taken to help me, unfortunately my pop up still doesn't want to work. Did you see that there are two pieces of code? Is it possible that the issue lies in the second piece?
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
I'll have to investigate this further. Please leave this with me for a bit longer. Thanks for your patience.
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
No problem. I just really appreciate your willingness to help. I will keep looking on my side as well. Thanks!
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello colinrkearney

I believe your code may be corrupted. I went through the HTMLbasix again and added a really simple pop-up window to your page and it seems to have worked. Please take a look on your pop-up-exit-survey page.

I suggest trying again and go through the process once more and see if you are able to reach success this time around.
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Wow, you have put in a lot of effort! I really appreciate that. I did see the pop up you created and yes it works (when I click the link). So here are three new questions: 1. can I add that code to the home page so the pop up page will pop when the home page is loaded?
2. how do I get it two work "automatically" without having to click the link? In other words to get the pop up to pop when the page loads.
3. can I add the code for the survey in the section where where the code states "click here for" ? Or does it not work like that?

Hope that all makes sense.

Again, thank you so much for all your efforts to help me! I really do appreciate it!
Photo of Sajid-M

Sajid-M

  • 119 Posts
  • 2 Reply Likes
I'm not sure about this problem at all, I'm not a programmer or anything, but I think for your first question you should use one of the 'on-entry' messages, like this one, which was one one of my old sites, if they click Ok, it proceeds, if they click cancel it returns to the previous page, I don't know about any cookie retrieving thing which looks like what was on your first code, but here it is:

<!--
<SCRIPT LANGUAGE="javascript">

function CONFIRM(){if (!confirm
("The text in the message box goes here"))
history.go(-1);return " "}
document.writeln(CONFIRM())
<!-- END -->

-->
For the second question, if you mean 'it to work' then the code above will appear when they enter the page.
I'm not sure about the third question, but I hope it all works out.
Photo of colinrkearney

colinrkearney

  • 13 Posts
  • 3 Reply Likes
Hi Sajid-M,

Thank you so much for your input. I will take a look at your suggestions.