开发者

Change the native confirm/alert [duplicate]

开发者 https://www.devze.com 2023-03-01 13:35 出处:网络
This question already has answers here: Changing the default title of confirm() in JavaScript? (8 answers)
This question already has answers here: Changing the default title of confirm() in JavaScript? (8 answers) 开发者_C百科 Closed 5 years ago.

I would like delete the title of my popup JavaScrip but i don't know how i can and where i make the code.

This is my code :

<a href="javascript:;"
 onclick="if(confirm('voulez-vous vraiment supprimer cette 
station?')) 
window.location.href='Supprimer_Station.php?id_sta=<?php echo 
$valeur['ssiphone_idstation']; ?>&act=supprimer'; ">

Tthanks for your help


You can't control the appearance of confirm() or alert() Javascript popups, because they are native controls, so their appearance is based on the OS and the browser.

What you can do:

  • create your own Javascript dialog
  • use a pre-written dialog like jQuery UI's dialog
  • if you don't want to include a full library (like jQuery UI) for a simple dialog, try something like javascript-simple-dialog


You mean alert? You can't control/remove the title from javascript alert.


You can't because confirm is a javascript function which you can't change. Might want to consider using other solution like a modal window where you can add custom header/title and stuff.

0

精彩评论

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

关注公众号