1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is there a way to create a pop up exit with blogspot?

Discussion in 'Blogging' started by dragon77, Mar 16, 2010.

  1. dragon77

    dragon77 Power Member

    Joined:
    Jan 18, 2009
    Messages:
    576
    Likes Received:
    685
    Occupation:
    Increasing 5 Figures to 6 Figures
    Location:
    BHW-Gold Mine
    Is there a way to create a pop up exit with blogspot?
     
  2. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Yep. In your dashboard click the 'layout' tab, and then 'edit html'. In between your <head> and </head> tags you need to add this code:
    Code:
    <script language='javascript'>
    var exitpop = true;
    function popup(){
    	
    if(exitpop==true) { window.open('http://www.google.com') }
    }
    </script>
    And then you need to change your <body> tag to this:
    'Save Template' and that's it :)

    Whoops almost forgot to add:
    Now if you don't want the popup to be triggered when a user clicks a particular link (ie and internal link on your blog), you need to select the 'Expand Widget Templates' checkbox, and manually edit each link to add 'onclick="exitpop=false"':
    Code:
    <a onclick='exitpop=false' ...
    This can be tedious and time consuming, but is necessary if you dont want the popup to fire every time a surfer licks on one of your blog posts.
     
    • Thanks Thanks x 5
    Last edited: Mar 16, 2010
  3. nixnash

    nixnash Power Member

    Joined:
    Oct 26, 2009
    Messages:
    581
    Likes Received:
    204
    Occupation:
    Student
    Location:
    BHW
    Thanks for the info...appreciate it,,
     
  4. dragon77

    dragon77 Power Member

    Joined:
    Jan 18, 2009
    Messages:
    576
    Likes Received:
    685
    Occupation:
    Increasing 5 Figures to 6 Figures
    Location:
    BHW-Gold Mine
    Great tips, It's good to know.
     
  5. miki308

    miki308 Newbie

    Joined:
    May 30, 2011
    Messages:
    20
    Likes Received:
    1
    Thank you for the code. it works well. Have a nice day.
     
  6. ciaozz

    ciaozz Junior Member

    Joined:
    Apr 17, 2008
    Messages:
    130
    Likes Received:
    27
    Won't blogger delete the blog for suspicious behavior? is this still work?