开发者

Javascript - Disable URL in alert

开发者 https://www.devze.com 2023-03-24 09:27 出处:网络
On the iPad my alert(\'hi\') pops up开发者_如何学C with a URL in the title zone.Can I turn this URL off?I do not want to see it.I am considering using some jQuery plugin as a workaround, but it sure w

On the iPad my alert('hi') pops up开发者_如何学C with a URL in the title zone. Can I turn this URL off? I do not want to see it. I am considering using some jQuery plugin as a workaround, but it sure would be nice to just fix it.


I don't think that can be turned off, alerts are defined in the browser itself. You can redefine alert (window.alert = jqueryAlertPLugin.alert) and not have to worry about your code calling the native one. I recommend the jAlert plugin. You will lose the blocking functionality of the native alert, but I bet that isn't usually an issue for most people.


You can't change the title of a javascript alert box, for user security reasons. You could use an alternative such as a pop-up <div>.

0

精彩评论

暂无评论...
验证码 换一张
取 消