Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Formatting font query

    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:

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

    Code:
    } // > 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:
    Code:
    # 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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    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
    Code:
    <p><%= getMsg("logout.no_longer_on") %></p>
    is easy. Just do it *right* using, CSS.

    Code:
    <p style="font-weight: bold;"><%= getMsg("logout.no_longer_on") %></p>
    or, even better,
    Code:
    <p className="ImportantMessage"><%= getMsg("logout.no_longer_on") %></p>
    and then supply a style for that class in your <style> section of the page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    SteveH (05-29-2012)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •