/    Sign up×
Community /Pin to ProfileBookmark

Dialogue Boxes

How do I insert line breaks and other such things into an alert or confirm box?

Also, is it possible to customise the options away from the default OK and Cancel?

Also, lol, why doesn’t it like when I try to concatenate stuff together to form the confirm message:

[code]function checkScreen() {
if (screen.width<=1152){
document.fullscreen.src=’images/full-screen-blinker.gif’;
if (confirm(“Your screen resolution is ” + screen.width + ” x ” + screen.height + “.
For resolutions of 1024 x 768 or lower, it is recommended that you switch to Theatre Mode, in order to view courses properly.
Would you like to switch to Theatre Mode now?”)) {fullScreen(‘Nav Test.html’)}
smallRes=true;}
}[/code]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinJan 18.2006 — to add line breaks and such, you need escapes "rn" will give you a carriage-return, line-feed

look up other escape sequences
×

Success!

Help @Mig spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...