75 posts
  • Has collected 100+ items on Envato Market
  • Located in United States
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
AaronMarquez says

Hello, How about a neat script that warns users when clicking links that are out of a specific site?

Okay, scenario.

A user is on a site called domainname.com , he clicks a link that goes to Google.com Well, what this plugin would do is make there be some kind of “confirmation” but not the ugly default confirm box. But it would say, when he clicked on that external link “are you sure you want to leave” or something like that. Something with a nice UI and responsive.

Does this exist or can anyone make something like this?

5487 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says
75 posts
  • Has collected 100+ items on Envato Market
  • Located in United States
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
AaronMarquez says

Thanks. Maybe you didn’t read my post in it’s entirety, I said I didn’t want to use the default “ugly confirm box.” Any alternatives? Thanks! :)

5487 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

I read your post, i take it you are a complete noob at this stuff?

Like deviantart use! http://www.deviantart.com/

341 posts
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Netherlands
+4 more
RikdeVos says

Yes, you can run a script when the user quits the page. You cannot however prevent him from leaving the page other than the default confirm box, this is because of security reasons. I suggest using something like this:

<script>
$(document).ready(function() {
   $("a").click(function() {
      //do stuff here
      if(!success) {
         return false;
      }
   });
});
</script>

But of course it won’t register events where the anchor tag isn’t clicked, so you should use the window.onbeforeunload as a backup.

362 posts
  • Sells items exclusively on Envato Market
  • Won a Most Wanted contest
  • Made it to the Authors' Hall of Fame
  • Has sold $10,000+ on Envato Market
+5 more
amzee says

I understood your requirement and can do it. Please PM me if you are still interested. Thanks.

75 posts
  • Has collected 100+ items on Envato Market
  • Located in United States
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
AaronMarquez says

I read your post, i take it you are a complete noob at this stuff? Like deviantart use! http://www.deviantart.com/
It’s not that I’m a noob, I’m simply suggesting one thing and you are giving me another.

Read the posts before you respond. This is the second time you’ve responded with some snide remark, no one is forcing you to post. I appreciate the help but when I ask a question and attempt to explain in further detail, there is no need to get snide.

75 posts
  • Has collected 100+ items on Envato Market
  • Located in United States
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
AaronMarquez says

Yes, you can run a script when the user quits the page. You cannot however prevent him from leaving the page other than the default confirm box, this is because of security reasons. I suggest using something like this:
<script>
$(document).ready(function() {
   $("a").click(function() {
      //do stuff here
      if(!success) {
         return false;
      }
   });
});
</script>
But of course it won’t register events where the anchor tag isn’t clicked, so you should use the window.onbeforeunload as a backup.
Thanks for the help!
75 posts
  • Has collected 100+ items on Envato Market
  • Located in United States
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 3 years
AaronMarquez says

Thanks for the answers guys.

5487 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

No problems, last time i will reply to one of your many threads

by
by
by
by
by
by