javascript --ALERT --

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

javascript --ALERT --

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

doesnt work in javascript, that was the first thing i tried

:roll:
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

hmmm...hold on, ill check my code, sure thats what i did
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

this works for me

Code: Select all

alert("Text Here. More text, More text,\n More text, More text, More text, ")
Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

maybe its just me :?
Post Reply