Current location: Hot Scripts Forums » General Web Coding » JavaScript » Please use [code][/code] or [highlight="language"][/highlight] wrappers! How & why...

Please use [code][/code] or [highlight="language"][/highlight] wrappers! How & why...

Closed Thread
  #1 (permalink)  
Old 06-01-06, 11:36 AM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,814
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Please use [code][/code] or [highlight="language"][/highlight] wrappers! How & why...

How: [code][/code] wrappers can be quickly inserted by clicking the # icon. Click once to insert the start wrapper and click again to insert the end wrapper. Or select the code and click the icon to wrap the entire selected text at once. You can of course insert the wrappers manually too.

Why:
  • They prevent smiley insertion.
  • They leave text formatting such as indents alone, making the code more readable/manageable.
  • They clearly outline code in contrast to other text.
  • They keep the post size down by adding scrollbars to the codebox when needed.
  • They make it somewhat easier to copy the code from the page.
  • vB code such as [B][/B], [I][/I] and [COLOR=Red][/COLOR] still work. -Does not apply to highligt wrappers
  • And some other things I don't remember now...

There is also the [PHP][/PHP] wrapper which includes a syntax highlighter for PHP code, but I don't recommend using it for JavaScript since the highligher can misinterpret it.


UPDATE:
We now have the [highlight=language] [/highlight] wrapper which basically works like the code wrapper, but it also adds syntax highlighting. There's no need to use the code wrapper if using the highlight wrapper. Announcement about available languages.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.

Last edited by TwoD; 06-14-08 at 07:23 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reason: Please use ... wrappers when posting code mab Hot Scripts Forum Questions, Suggestions and Feedback 0 01-16-07 09:50 AM
Error Danyal PHP 9 10-08-06 08:20 PM


All times are GMT -5. The time now is 05:35 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.