When you use javascript's alert() function within a PHP script or HTML page to notify the user of something, you usually get a dialogue that says:

The page at 123.456.78.9 says:
blah blah blah

Is there any way I could eliminate the IP part and simply display my desired message?

有帮助吗?

解决方案

The javascript alerts by default gets the current domain name.

You can go for alternating solution of using some custom popups.

There is one jquery plugin Impromptu, in which you can show customized popups. It also has other features.

The basic example of showing it :

$.prompt('Hello World');

It displays popup with message 'Hello World'

for more details, refer to this link

其他提示

That is the default title style for Javascript Alert box and you cannot change that

If you want to work with changing the title of alertboxes , you could make use of JQuery Alert Dialog.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top