...

View Full Version : Formatting font query



SteveH
05-29-2012, 07:47 PM
Hello

I have a basic Web chat script that combines JS and ASP. I am trying to format a snippet of code so that I can change the font size, nothing else.

Part of the chat uses a couple of ASP snippets:


<p>

<%= getMsg("logout.no_longer_on") %></p> in a file called 'expired.asp' and this:


} // > function onUsersChanged(..)

/**
* This user has logged off.
*
*/
function onLoggedOff() {
alert('<%= getMsg("logout.no_longer_on") %>');
parent.location.replace('<%= LOGGED_OUT_PAGE %>');
}

// -->
</script>

in a file called 'message.asp'.

These two snippets draw on this:
# logout screen
logout.no_longer_on=You are no longer logged on. Thank you for your visit. which is contained in another file called 'messages.en' in order to thank the visitor who is logging off.

What I would like to do it font-format this: You are no longer logged on. Thank you for your visit., but I am not sure how to do it.

Thanks for any advice.

Old Pedant
05-29-2012, 09:14 PM
Okay, for starters, you can't format alert( ) output.

You should probably stop using alert( ) as soon as possible, anyway, as some browsers now give users the option to turn off alerts.

But in any case, the code for

<p><%= getMsg("logout.no_longer_on") %></p>

is easy. Just do it *right* using, CSS.



<p style="font-weight: bold;"><%= getMsg("logout.no_longer_on") %></p>

or, even better,


<p className="ImportantMessage"><%= getMsg("logout.no_longer_on") %></p>

and then supply a style for that class in your <style> section of the page.

SteveH
05-29-2012, 10:10 PM
That's great stuff, Old Pedant - thank you!

(I don't really know what the 'alert' was there for. I downloaded the files - the author stated they were available to be customised - but even without modification I couldn't see one of the 'alert' dialogue boxes pop up anywhere).

I have now removed it as you suggested, and it works fine without it.

Thanks again.

Steve



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum