Solved

Change title bar text and make new line-alert function

Posted on 2000-04-23
11
307 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
*agrees* you cannot change Title text.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Expert Comment

by:bark10
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
agree with kollegov
0
 
LVL 2

Author Comment

by:READER
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

763 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

10 Experts available now in Live!

Get 1:1 Help Now