Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,454 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,978 people online right now. Registration is fast and FREE... Join Now!




alert()

 
Reply to this topicStart new topic

alert()

velaphi
22 Jul, 2008 - 12:05 PM
Post #1

New D.I.C Head
*

Joined: 20 Jul, 2008
Posts: 8

Hi i am trying to arrange the alert output in vertical e.g
The Sum is: 3
Average 4
Product 9
largest 9
smallest 3

CODE
alert("The Sum is: " + total  + "  Average: " + average + "  product: " + product +" largest " + largest + " smallest " + smallest)

User is offlineProfile CardPM
+Quote Post

BetaWar
RE: Alert()
22 Jul, 2008 - 02:51 PM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 2,022



Thanked: 81 times
Dream Kudos: 1175
My Contributions
Because javascript doesn't support new line characters in the middle of code (like so)

CODE
alert("test
more");


You have to type in the new line character for it to work (\n)

So it would look like
CODE
alert("test\nMORE TEXT");


Hope that helps.

This post has been edited by BetaWar: 22 Jul, 2008 - 02:51 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:13PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month