Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the native confirm/alert [duplicate]

Tags:

javascript

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

like image 975
a7mad861 Avatar asked Apr 27 '11 11:04

a7mad861


2 Answers

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
like image 100
kapa Avatar answered Oct 17 '22 21:10

kapa


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

like image 4
Zeeshan Ali Avatar answered Oct 17 '22 22:10

Zeeshan Ali