Scripts not running in FF and Chrome - javascript

I am using javascript alert message to show validation messages. In Firefox and Chrome first time working fine,second time for same alert same its asking message like "Prevent this page from creating additional dialogs" with check box. After select that check box, Next time button click scripts not executing. How to block that message?

Use a JavaScript Modal popup! eg. JQuery UI Modal Popup

This is a browser matter, so you as a developer cant do anything with that behavior.
Here is a similar question
already answered here

unfortunately you can't be sure that user has his browser settings with javascript alerts popup on ( that called with 'alert('...') function').
You should use javascript dialog plygin instead.
For example:
http://fancybox.net/

its a browser property for the client,if he doesnt want to view these alerts. you cant remove that check box and message.
if this message is shown then what the problem, leave it for the user.
why you want to force him to view these alerts,
it must be user's wish to see or not see these alerts.
for better user experience and for your purpose you can use fancybox or facebox
fancy box fiddler check this http://jsfiddle.net/BJNYr/

Related

How to display “allow dialogs from … to take you to their tab” in an alert?

I was in a website where an error message appeared in an alert dozens of times, saying only:
error :(
I’m used to websites automatically displaying a checkbox labeled “prevent this page from creating additional dialogs” after many error messages. This should have happened to the above site, but it didn’t. Instead it displayed a checkbox “allow dialogs from [example.com] to take you to their tab?”
Do you know why this happened? How do I reproduce this behavior in my own website?
PS: My browser is Firefox 72.0.2.
EDIT
4 months... Nobody have ever seen such a message?
This shows up in Firefox when a page that is not in view (some browser tab that is not activated) tries to display an alert() dialog. You might get this when some code that runs in background creates an alert message: like when you press a button, and some code runs in the background and you switch to another tab, and now the old tab finishes running and displays alert dialog.

window.confirm message not working when user disables additional dialogue from the browser

I am new to java script. And now have gone into a really serious problem.
Please help..................! stackoverflow
I have one jsp page for deleting entries. where user can delete data. As soon as he clicks delete button , he gets a confirmation window saying "Are you sure you want to delete..?". Problem is when user deletes 4,5 entries he gets an alert from the browser saying " [*] Prevent this page from creating additional dialogues." when user clicks the checkbox and prevents himself getting additional dialogues. my confirmation message "Are you sure you want to delete?" also gets blocked and user is unable to delete the data and the whole portal becomes useless.
please help me and let me know is there any way to handle that using javascript.
Browser alerts are little irritating. Create your custom popup or use Jquery popup. You cannot control browser alerts behaviour
You can use one of the best plugin for alerts and confirm dialogs
http://nakupanda.github.io/bootstrap3-dialog/

PHP Alert Box - The Page at localhost says

I use alert box in PHP forms and get something like this;
PHP Alert Box - For eg: The Page at localhost says .. "Your username is invalid"
Is it possible to customize the text "The Page at localhost says"?
That's the property of the Browser you're using & You can't modify. Instead You can use a custom javascript alert box.
jQuery Alert Dialog
No you cannot. javascript alert box title cannot be modified.
The javascript alert() is an inbuilt method. And you can not override it.
Try jQuery UI Dialog
http://jqueryui.com/dialog/
Alert Box Says Can Not Change Because it depends on the browser. In Google Chorme The Alert box properties and firefox the alert box is different. To get rid of this problem you have to use custom alert box.
This link may help you.
https://www.freshdesignweb.com/jquery-javascript-popup-window.html
Alert Box Says Can Not Change Because it depends on the browser. In Google Chorme The Alert box properties and firefox the alert box is different. To get rid of this problem you have to use custom alert box. This link may help you. https://www.freshdesignweb.com/jquery-javascript-popup-window.html

How to not wait for something with Watir-Webdriver

So I'm writing a watir-webdriver script, and my app is using javascript to present a modal window that I want to interact with. When I click the element that presents the modal window, watir-webdriver just sits there until eventually it times out and i see a Timeout::Error on the console window. This is before attempting to interact with the new window at all. I'm assuming it's polling the DOM for some change and not getting it, how do I tell it to move on without waiting?
The answer ended up being, and then handling the necessary waiting manually
element.focus
element.send_keys :return
Ruby 1.9.3/ IE 9 - I had a click_no_wait error. Watir would not trigger a click on the Save button, which had to be followed by a click on a java popup 'OK' button that confirmed that the save button had saved the document correctly.
Using these two lines in place of the click_no_wait command gets the code working perfectly:
element.focus
element.send_keys :return
Thanks DVG. My code -
ie.button(:id, 'MainContent_B_Save').focus
ie.button(:id, 'MainContent_B_Save').send_keys :return
ie. javascript_dialog.button('OK').click
If this is a Alert, Confirm, or Alert type JS popup, see this answer: https://stackoverflow.com/a/8172888/409820

Popup a message upon exiting a webpage

We'd like to have a message popup when a visitor to specific webpages leave those webpages. So we could tie some Javascript to the links on those webpages, but then we can't control if the user exited the webpage by typing in a URL, using a bookmark or just closing the window...
I assume we have limited options if the user tries closing the browser window... but I do know it's possible because Google Docs' Documents offers the chance to cancel closing the window if you have unsaved work while closing the browser.
What are my options? Can I have Javascript called upon going to another webpage? Can I control the text in the popup when trying to close the window?
I'm using jQuery, so if there are good solutions implemented with jQuery that's perfectly fine.
Yes.
https://developer.mozilla.org/en/DOM/window.onbeforeunload
jQuery UI Dialog OnBeforeUnload
There is onunload event you can bind to, first example:
http://www.codetoad.com/javascript/miscellaneous/onunload_event.asp

Categories