Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-29-2012, 11:49 AM   PM User | #1
coquinenet
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
coquinenet is an unknown quantity at this point
Convert a script in popup popunder

Hi

I have a script for popup but i want convert this script popunder
Is that possible ? thx for your help

Code:
<script type="text/javascript">// <![CDATA[
var cookieinfo;
function CookieExist(CookieName) { cookieinfo = document.cookie; if (cookieinfo.indexOf(CookieName) == -1) { return false; } else { return true; } }
function SetCookie(CookieName,CookieArgs,CookieExpire) { document.cookie = CookieName + "=" + CookieArgs + ";" + "expires=" + CookieExpire; }
function GetCookie(CookieName) { if ( CookieExist(CookieName) ){ d = cookieinfo.indexOf(CookieName) + CookieName.length + 1; f = cookieinfo.indexOf(";",d); if ( f == -1) { f = cookieinfo.length; } return (cookieinfo.substring(d,f)); } else { return ("0"); } }
// ]]></script>
<script type="text/javascript">// <![CDATA[
var pup=0;
function popup ()
{
if(pup===0)
{
pup=1;
if(GetCookie("deja_clique")==1)
{
return;
}
else
{
SetCookie("deja_clique",1,"");

var popun=String
      
popun[0]="http://www.yahoo.com";
popun[1]="http://www.facebook.com";
popun[2]="http://www.google.com";


resultat = Math.floor(Math.random() * 3);

window.open(popun[resultat], "","toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,menuBar=1,width=30000,height=30000");
window.focus();
popup.blur();
}
}
}
document.onclick=popup;
// ]]></script>
coquinenet is offline   Reply With Quote
Old 12-29-2012, 10:32 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
What is a popunder???

Do you mean a "pop over", actually? That is, you use a <div> on the same HTML page, put the content in that <div>, and then have the <div> appear over the top of the rest of the HTML???

That's not possible to do if you are trying to put the content from an entire URL into a <div> unless you put an <iframe> inside the <div>. Unfortunately, some sites--most notably Google--will *NOT* allow themselves to be placed inside an <iframe>.

So... Explain what you mean by "popunder" and explain what the purpose is.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:37 PM.


Advertisement
Log in to turn off these ads.