Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alert function
Message
De
12/03/2003 10:22:29
 
 
Information générale
Forum:
Internet
Catégorie:
Javascript
Titre:
Divers
Thread ID:
00764480
Message ID:
00764783
Vues:
32
>>
>>function myalert( AlertTxt, AlertTitle )
>>{
>>var DspHtml="about:<head><title>"+AlertTitle+"</title></head>"
>>DspHtml=DspHtml+"<body><center>"+AlertText+"<br><button onclick='window.close()'>OK</button></center></body>"
>>showModalDialog( DspHtml, "", "dialogWidth:200px;dialogHeight:50px;status:0;help:0;resizable:no;scroll:no" )
>>}
>>
>>
>Doesn't work or I can not make it to work :( Can you show a sample of usage? If I leave alert(msg); it works, but if I put MyAlert(msg,myTitle) it doesn't execute the script and goes to the next page...
>
>What should I do?
>
>http://twg-dev-dq.thewarrengroup.com/creditrecords/FormResult.asp (click on Add to Cart without making selections).
>
>You have to create an HTML first, it seems:
>final public Variant showModalDialog( String dialogUrl, Variant dialogArgs, DhDialogInfo di )

There is a spelling mistake in the original - AlertTxt & AlertText. I was copying from code on a different PC to this one, I didn't spot the mistake. The following works on IE5.5 & 6.
<html>
<head>
<script>
function myalert( AlertTxt, AlertTitle )
{
var DspHtml="about:<head><title>"+AlertTitle+"</title></head>"
DspHtml=DspHtml+"<body><center>"+AlertTxt+"<br><button onclick='window.close()'>OK</button></center></body>"
showModalDialog( DspHtml, "", "dialogWidth:200px;dialogHeight:50px;status:0;help:0;resizable:no;scroll:no" )
}
</script>
</head>

<body>
<button onclick="myalert( 'Text', 'Title')">Click Me</button>
</body>
</html>
Len Speed
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform