Page 1 of 1

javascript --ALERT --

Posted: Thu Jul 08, 2004 10:27 am
by malcolmboston
ok some quick fire questions as im currently using alert boxes for something in a CMS..

ok say you have this code

Code: Select all

alert("Text Here. More text, More text, More text, More text, More text, ")
now we all know what the output looks like, but i want to know if its possible to change some things.

1) The title for the alert
?? can this be changed (in internet explorer it says Internet Explorer, i want this to change to the title of an error message)

2) Add new lines in the box
now this one has me stumped, i hate javascript so dont really use it, and have no idea of new line conventions or anything in javascript

for example.

Id like the output to be something like--

There has been an error on the page.

Error: Site out of sync
ive tried lots of ways of getting new lines, and none work

any help on the above mentioned questions would be great

Thanks
Mal

Posted: Thu Jul 08, 2004 10:29 am
by JayBird
Don't think you can change the title of the box

new line = \n


If you really want your own title, you could produce your own pop-up windows using DIVs and style them however you want.

Mark

Posted: Thu Jul 08, 2004 10:31 am
by malcolmboston
doesnt work in javascript, that was the first thing i tried

:roll:

Posted: Thu Jul 08, 2004 10:31 am
by JayBird
hmmm...hold on, ill check my code, sure thats what i did

Posted: Thu Jul 08, 2004 10:32 am
by malcolmboston
Bech100 wrote:Don't think you can change the title of the box
If you really want your own title, you could produce your own pop-up windows using DIVs and style them however you want.

Mark
i was planning toon doing this should i not be able to get this workin
(check PM in 2 mins)

Posted: Thu Jul 08, 2004 10:36 am
by JayBird
this works for me

Code: Select all

alert("Text Here. More text, More text,\n More text, More text, More text, ")
Mark

Posted: Thu Jul 08, 2004 10:38 am
by malcolmboston
maybe its just me :?