[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Giving title for JavaScript Alert message

Posted on 2004-09-14
6
Medium Priority
?
360 Views
Last Modified: 2010-05-18
Hi All...
           Can anyone help me on this issue. I m working on JavaScript and in case of JavaScript alert messages its title is shown as "Microsoft Internet Explorer" as I m using IE5 as my browser. I want to give my own title in the alert meassage. Is it possible?? If yes then write me how. Waiting for your reply..

Shamakant Sharma.
Sr. Programmer
Path Infotech Ltd.

0
Comment
Question by:shamakant_sharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12053125
You can't.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12053130
//iE soln only, use vbscript
<HTML>
<script language = VBScript>
Sub alert(title, content)
     MsgBox content, 0, title
End Sub
</script>
<body>
     <input type = button value = "Click " onClick = "alert 'My title', 'Hello World'">
</body>
</HTML>
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12053156
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 12053165
//create your own ( credit to mplungjan )
<html>
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"><!-- //
function fakeAlert(cMsg,cTitle,cImg) {
alertOptions="screenX=500,screenY=400,top=400,left=500,height=100,width=200,hotkeys=no"

newWin=window.open("","fakeAlertWindow",alertOptions)
newDoc=newWin.document
newDoc.write('<ht'+'ml><he'+'ad><tit'+'le>'+cTitle+'</tit'+'le></he'+'ad><bo'+'dy bgColor="silver" onLoad="document.forms[0].elements[0].focus()">');
newDoc.write('<table><tr><td><img src="'+cImg+'" width=34 height=34 alt="" border=0></td>');
newDoc.write('<td><font size="-1">'+cMsg+'</font></td></tr>');
newDoc.write('<tr><td colspan=2 align="Center">');
newDoc.write('<form><input type="button" value="OK" onClick="window.close();"></form>');
newDoc.write('</td></tr></table></bo'+'dy></ht'+'ml>');
}
//-->
</script>
</head>
<body>
Fake alert box.
<form name="frmMain">
<input type="button" value="Click Me" onClick="fakeAlert('This is a fake alert box.','Alert title','icon2tr.gif')">
</form>
</body>
</html>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question