Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
http://i58.tinypic.com/2ni6vpw.png

this is the popup I'm having every 20 seconds on my program when trying to leave page to another link but don't know a way of closing it automatically.
how could I get rid of this annoying popup...

by the way, I'm in VB.
Posted
Comments
[no name] 20-Apr-14 17:22pm    
If it's that annoying to you, take it out of your program.
NOEL14 20-Apr-14 17:27pm    
I didn't put it in my program... its a popup from the link I visit
[no name] 20-Apr-14 17:32pm    
Are you telling me that you did not write "this is the popup I'm having every 20 seconds on my program"? Now suddenly it's not your program? Which is it? If it's not your program as you claim now, stop visiting that site. Pretty simple.
NOEL14 20-Apr-14 17:48pm    
I have that popup from my program every 20 seconds right but because its visiting the link every 20 seconds... stop being rude for nothing
[no name] 20-Apr-14 18:55pm    
I think that I am fairly fluent in Canadian but I am certainly failing to see where I am in any way "rude" to you. Are you seriously blaming me that you don't know if it is your program or not? If you don't like the popups then stop going to that site. Simple solution for your problem. If you really don't like the popups then ask the web site administrator to remove them. Other than that, there is not a single line of code in your posting that demonstrates that you have tried anything at all to solve your problem yourself.

1 solution

If you are getting it while leaving the page, then either or both of the following reasons is true...
  • You have some unsaved changes on some input boxes on the current page.
  • There is one Event onbeforeunload[^] defined in your code for the current page.
 
Share this answer
 
Comments
NOEL14 21-Apr-14 15:54pm    
I checked and its not related to my program but the webpage itself that trowing some error message asking me to leave this pas or stay on page...

when I press manually on leave page twice it continue to the best...

but you right for the onbeforeunload... I think there is a function like that they putted on that web page to trigger this when leaving...

but the big question what coding should I use to click on the button leave twice or simply force close thoses popups...
To remove that, you can try setting the event to null like...

// Turn it off - remove the function entirely
window.onbeforeunload = null;

Refer - http://stackoverflow.com/a/1119324/1099247
NOEL14 22-Apr-14 12:46pm    
Tadit.... this is what seems to be the problem... but im in VB.NET... and want to remove it from the program in VB.net to trigger that window.onbeforeunload when site I visit in my webbrowser on my project in vb...

nothing in the program have codes to do window.onbeforeunload
its the link I visit from my program that does it...

just to be clear.
I don't get you clearly, but I guess you are visiting one external link from your code. In that case, you can't trigger this event. Because it is in another domain.

Initially, I thought it was in your domain.

So, conclusion is simple. As it is one external website, you can't control its behaviour from your code.
NOEL14 22-Apr-14 12:55pm    
even if I do a invokescript ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900