0

i am trying to use javascript alert function

<img  onclick="alert(\''+marker.PlaceName+'\');"/> 

it give alert but in some mobile devices such as android samsung galaksy s2 it does not just give message(marker.PlaceName) it also gives alert or javascript info how can i override this? enter image description here enter image description here

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user1688401
  • 1,851
  • 8
  • 47
  • 83

2 Answers2

1

The problem

How a browser displays an alert is a browser level feature and can't be changed by the user. If you want more control over your display experience you can build a custom popup box or use a library to do so.

The Reason

You can't edit these alert boxes due to security reasons. It would be inadvisable to allow developers to edit the appearance or behavior of browser level messaging systems due to phishing risks.

Alternative Examples

Community
  • 1
  • 1
Ben McCormick
  • 25,260
  • 12
  • 52
  • 71
0

I would suggest not to use alerts at all, browser keeps tracks of alerts and use of alerts in web development is frowned upon. Chrome even asks user if one wants to disables alerts on a page if the page is generating a lot of them. I would suggest using some sort of success, error and notification messages driven by jQuery. There are open source libraries that you can use to do the same. Parsley is a very good example.

RedBirdISU
  • 79
  • 1
  • 4