Question

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?

Était-ce utile?

La solution

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top