Results 1 to 7 of 7

Thread: Wait don't leave dropin...?

  1. #1
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Wait don't leave dropin...?

    Hey all, I need a bit of help.

    The client is requesting a wait don't leave drop in, much like a wait don't leave popup that presents the user with a deal using the onUnload event in javascript. At first I thought this was impossible, but now it seems almost possible.

    I've created the dhtml drop-in using javascript function on on the onbeforeUnload event attached to the body, then, used one of these guys for on the unload: document.execCommand('Stop');. I'm aware that this only will work in ie, and the client is fine with that. (90%+ users are using IE on this site).

    The problem here is that I need to capture the url they were about to go to, so I can add that to a link on the drop in. As it is right now, this code makes it impossible for IE users to leave the site. The drop in will have a special offer, with a "buy now" link and a "leave the page" link. I need that "leave the page" link to go to whatever link they were going to go to.

    Is there any way to capture this information? Just getting the info from links on the page, should not be to difficult, but all of the links on the page will have the dropin suppressed anyway, that's now what I need. I need to capture the url if it is typed into the address bar, or accessed from a bookmarked link.

  2. #2
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Bump, Bump.

    Sorry, I need this.... anyone?

  3. #3
    Join Date
    Feb 2007
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm pretty sure that's impossible.
    "Rock and roll ain't noise pollution." - AC/DC

    http://www.blake-foster.com

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not sure how you got that much working. There may be no solution but, if I could see your actual page, I might be able to figure it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here's what I've come up with so far. I just need a way to capture the page they were about to go to. At first, I thought what I've done thus far was impossible, but it's not. So, I'm not giving up on this just yet. By the way, I got rid of the drop-in JS, and replaced it with a simple showDiv function to clean up the code, since that's not what I'm having a problem with.

    HTML Code:
    <html>
      <head>
        <style>#dropInDiv {  border:1px solid #000;  background:#ddd;  position:absolute;  top:200px;  left:200px;  display:none;}</style>
        <script>
        function showDropIn(divName){
          document.getElementById(divName).style.display='block';
        }
        function leaveSite() {
          //this is what I'm missing!
        }
        </script>
      </head>
      <body onbeforeunload="showDropIn('dropInDiv')" onunload="document.execCommand('Stop');">
    
      <div id="dropInDiv">
        <p>wait dont leave!</p>
        <p>take an additional 10% off now.</p>
        <ul>
          <li><a href="fakelink.htm">Give me 10%off</a></li>
          <li><a href="javascript:leaveSite();">Just let me leave already!!!</a></li>
        </ul>
      </div>
    
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dolor. Nullam blandit tristique dui. Proin venenatis mattis arcu. Suspendisse potenti. Integer placerat nisl sit amet erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque fringilla lorem eget mauris. Nunc fermentum pellentesque leo. Proin orci orci, sollicitudin vel, iaculis et, facilisis eu, justo. Nunc libero quam, ornare a, vestibulum id, rutrum eget, dolor.</p>
      </body>
    </html>
    Thanks for having a look, Much appreciated.

  6. #6
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am very sorry but it is pretty much seeming impossible -
    well there is only one solution and its not that good anyway but if you do want to know jus ask

  7. #7
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Please by all means.

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
  •