javascript messagebox use

J

JohnE

Hello. I am using the quick and dirty javascript messagebox for
instructional messages during certain events. Below is the setting up the
messagebox. Then I use AlertMessageBox("The instructional information to the
users here.") in different events. But there are times when the message can
get long.

private void AlertMessageBox(string message)
{
if (!string.IsNullOrEmpty(message))
{
Response.Write("<script type=\"text/javascript\"
language=\"javascript\">");
Response.Write("alert('" + message + "');");
Response.Write("</script>");
}
}

How do I get a second line, like a carriage return to create the next line?
Sample or links are good.

Thanks.
 
W

William Niver

Howdy!

\r is a carriage return (the r literally stands for "return") in JavaScript.

William
 
J

JohnE

JohnE said:
Hello. I am using the quick and dirty javascript messagebox for
instructional messages during certain events. Below is the setting up the
messagebox. Then I use AlertMessageBox("The instructional information to the
users here.") in different events. But there are times when the message can
get long.

private void AlertMessageBox(string message)
{
if (!string.IsNullOrEmpty(message))
{
Response.Write("<script type=\"text/javascript\"
language=\"javascript\">");
Response.Write("alert('" + message + "');");
Response.Write("</script>");
}
}

How do I get a second line, like a carriage return to create the next line?
Sample or links are good.

Thanks.

Just several other items I've tried. If I put \n or \r\n or \r inside the
AlertMessageBox then the message does not show at all. The page will show
without ever going past the alert.
John
 
J

JohnE

William Niver said:
Howdy!

\r is a carriage return (the r literally stands for "return") in JavaScript.

William

Thanks for the quick response. But it skips over the alert with out showing
it. An example is AlertMessageBox("This is how I have tried getting the
return to show a second line in the message box. \rBut it is not showing the
alert.")

As mentioned, I tried the \n, \r\n, and \r, but when I do, the message does
not show. Puzzling. Because when I take out the return, the message shows
in a long line.

John
 
S

Scott M.

Maybe I missed something, but I don't see the OP using the language
attribtue, it looks like he was using the correct type attribute from the
get go.

-Scott
 
S

Scott M.

The content in the article you reference fall into two categories:

1. Don't top post because the usenet doesn't like it.
2. Don't top post because of our subjective reasoning.

--------------------

1. We've come a long way since the inception of the Usenet and loose rules
designed for its implementation 20 years ago don't hold up as well today.

2. I can make a counter point to each of the subjective reasons listed, but
in short, I disagree that the majority of users prefer bottom posting and I
outright find it ridiculous to have to scroll down just to see a reply from
the last post. I will inline when the reply is lengthy, but I prefer top
posting because if you are following the thread, you've already read all the
other stuff that you are suggesting we put our reply below.

Bottom line: to each his own. There is no verdict on this. Please don't
try to enforce something that you are not responsible for and that there
isn't a concensus on.

-Scott
 
E

Ed Murphy

Scott said:
2. I can make a counter point to each of the subjective reasons listed, but
in short, I disagree that the majority of users prefer bottom posting and I
outright find it ridiculous to have to scroll down just to see a reply from
the last post. I will inline when the reply is lengthy, but I prefer top
posting because if you are following the thread, you've already read all the
other stuff that you are suggesting we put our reply below.

This argument against bottom-posting has been raised many times before,
but it's really an argument against failure to trim quoted text down to
just the part you're replying to.

Personally, I use Thunderbird with the QuoteCollapse add-on for Usenet
and personal e-mail; for work e-mail, the culture leans overwhelmingly
toward top-posting, so I follow suit unless clarity demands inline.
 
S

Scott M.

Or, they've already been reading the thread and don't have to scroll at all
just to see the last tidbit added!

Let go of the "When I was a kid, we used the Usenet like this..." mentality.
If you don't like it, don't read it.

But, PLEASE don't think for a moment that you are somehow the diffinitive
word on how to post or that you have any kind of authority.

I won't bitch when you bottom post (even though I don't like it) and you
have no need to do so when others top post (and yes, there are MANY of us
who prefer it).

-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top