SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript pop up example?

    I read this article, but I have no idea how to implement this on my site.
    http://www.webmasterbase.com/article/648/23

    The article has the codes, but it doesn't show me exactly where to implement the codes.

    Also, I would like to set the cookie to expire in 10 hrs. How can I do this?

    Thanks for your time and assistance!

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think this *might* work


    <script language="JavaScript" type="text/javascript">
    <!--
    function doPopup(){
    var ezine = getCookie('popupShown'); setCookie('popupShown', 'true', '', '');
    if(ezine == '') { // Show the popup window window.open('ezine.html', 'ezineWin', 'width=500,height=400'); }}

    var nowTime = new Date();
    nowTime.setTime(nowTime.getTime() + 10*60*60*1000); cookieExpires = nowTime.toGMTString();
    // --> </script>

    <body onUnload="doPopup()">



    Now im not sure about the hour thing.. someone please correct me if im wrong i just changed from date????
    Last edited by Wbmstr84; Mar 4, 2002 at 19:39.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does onUnload do? Can I use 'onLoad' instead?

    <body onUnload="doPopup()">

    I want people to see the pop ads when in their first visit each day.

  4. #4
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please note the change i just made....

    <body onUnload="doPopup()">

    will call on the function and activate the popup script when someone leaves the page.

  5. #5
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry then just change to
    <body onload="doPopup()">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •