Solved

Change title bar text and make new line-alert function

Posted on 2000-04-23
11
309 Views
Last Modified: 2012-05-04
Is there a way to change the text in the title bar of an alert box.

Also is there a way to make the text go to a new line instead of forcing it by using spaces.

Here is the alert function as I am using it to bring up the alert dialog box along with the spaces I am using to force a new line.

<a href="" onmouseover="alert ('Netscape  -- Hold Shift Key & Click on Reload                                             Internet Explorer -- Hold Control Key & Click on Refresh');return true;"><img border="0" src="ANsound.gif" width="100" height="30" alt="Swing Dance Music">
</a>

This is being used with the "sound" animation image at the top of http://www.dancedk.com
0
Comment
Question by:READER
  • 2
  • 2
  • 2
  • +4
11 Comments
 
LVL 1

Accepted Solution

by:
lambda earned 50 total points
ID: 2742799
U can use '\n' for new line, '\t' for tab etc.
alert ('Netscape  -- Hold Shift Key & Click on Reload\n Internet Explorer -- Hold Control Key & Click on Refresh');
0
 
LVL 2

Author Comment

by:READER
ID: 2742895
lambda

Thanks for solution to create new lines.

Is there a way that I can change the text that shows up in the blue bar at the top of the alert box?

0
 
LVL 1

Expert Comment

by:lambda
ID: 2743008
I don't think so, but I am not sure. Better wait for some other expert to come up...
Sorry!

£.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2743025
No, this isn't possible.

Give Lambda the points....

another thing. All the \x things from C++ an stuff work in javascript  except not the \a which makes a BEEEEEEP.....=)
0
 
LVL 1

Expert Comment

by:Subhuman
ID: 2743219
*agrees* you cannot change Title text.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:bark10
ID: 2743543
You cannot change the title in a Javascript alert box BUT, you can imbed Visual Basic in your scripts and use the MsgBox function.  This function does allow title change and gives much more freedom with buttons.

The best explaination I have seen of this is http://www.webreference.com/dhtml/column22/js-vbNewvb.html

The \x characters still work with this.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2743585
A messagebox is something else as an alert box. A messageBox can contain any button you want, predefined though...

0
 
LVL 3

Expert Comment

by:bark10
ID: 2743605
Thanks CJ_S, I know this ...

....but as I said, it gives you much more freedom than an alert box and you can have the same ALERT icon in the msgbox.  This can probably be incorporated to fit READERS needs.
0
 
LVL 10

Expert Comment

by:kollegov
ID: 2743854
Don't think VB dialog is a good solution..
I'd suggest to pop up html window

w=window.open('alert.html','_blank','width=300,height=200');

And write HTML in alert.html file
At least <TITLE> will be in your hands
now :-)
And no problems with formatting :)


0
 
LVL 3

Expert Comment

by:packratt_jk
ID: 2744609
agree with kollegov
0
 
LVL 2

Author Comment

by:READER
ID: 2745200
Thanks to all for some great suggestions.

I am giving the points to lambda because he was first with the answer to the original question which related
specifically to using the "alert" function.

I have lots of homework to do in checking out all the other suggestions.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now