Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Making an alert appear when visiting a website? jQuery or JavaScript

Hello all,

I was wondering whether it is possible to do the following in a web browser:

I want to be able to type in a web address (on a website) and have it save the address. Then, if I try to visit that website, it would have a jQuery alert signal pop up asking if you really want to go to that website? I know that I am able to have alerts appear on my website, but can I have my website produce a popup before entering another site?

I know that there are plug ins and applications that can stop you from visiting websites (Facebook -.-), but I was curious whether you can make one for a web browser.

I was thinking of having variables attached to each website and somehow have the input from your search window checking each variable to make sure that website wasn't listed as one that you didn't want to visit.

If any of my descriptions or functionalities were confusing, let me know.

Thanks!

Yes you can make one for a web browser, go to chrome's plugin page.

Check out this plugin:

Block site

1 Answer

Then, if I try to visit that website, it would have a jQuery alert signal pop up asking if you really want to go to that website? I know that I am able to have alerts appear on my website, but can I have my website produce a popup before entering another site?


How would you access to that website ? If you go to your web address inside of your brower, your site won't be able to check the input. That would be possible with a browser plug-in I guess but not really with a simple website.

But if you enter the url inside of your website, in a form or something, then you would be able to check if the link is already saved and if you want to put some alert or confirm dialog box.

I wasn't sure if it was possible. How exactly do plug-ins work?

And I would like my website to use its stored information to see whether something I type in the address bar matches the stored information on my website. If it does, it would have a pop up appear before actually loading the website you were trying to go to.

Here is chrome's blog on plugins for the chrome browser:

https://developer.chrome.com/extensions/getstarted

Jacob Mishkin Thanks for the link!

Not a problem.