When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Software Developer/Programmer - Interview NOW! Need 10 People!
Next Step Systems
US-IL-Des Plaines

Justtechjobs.com Post A Job | Post A Resume

VBScript-to-JavaScript Functions


Many web developers enjoy using VBScript, due to its many nice, inherent functions. However, Internet Explorer is the only browser which supports VBScript, so for production web applications it is essential that all client-side scripting be written in JavaScript.

No problem, though, we can write VBScript - like functions in JavaScript! Below you'll find a number of VBScript functions implemented in JavaScript. If you decide to use any of these (which I hope you do), please simply include the below lines of text in the JavaScript code, and drop me an email giving me the URL of your site, so I can see your hard work.

     // JavaScript Functions Written by:
     //    Scott Mitchell
     //    mitchell@4guysfromrolla.com
     //    http://www.4GuysFromRolla.com


FormatNumber(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UserParensForNegativeNumbers, GroupDigits) Returns an expression formatted as a number.
FormatPercent(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UserParensForNegativeNumbers, GroupDigits) Returns an expression formatted as a percentage (multiplied by 100) with a trailing % character.
FormatCurrency(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UserParensForNegativeNumbers, GroupDigits) Returns an expression formatted as a currency value.
FormatDateTime(Date, FormatType) Returns an expression formatted as a date or time.
LTrim(string) Returns a string without leading spaces
RTrim(string) Returns a string without trailing spaces
Trim(string) Returns a string without leading and trailing spaces
Len(string) Returns the length of the specified string.
Left(string, length) Returns a specified number of characters from the left side of a string.
Right(string, length) Returns a specified number of characters from the right side of a string.
Mid(string, start, length) Returns a specified number of characters from a string.
InStr(strSearch, charSearchFor) Returns the position of the character charSearchFor in strSearch


Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers