Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2005, 06:18 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default encodeURIComponent(); function

hi all,
I found this function in the source page of google search page by chance. Is it a core javascrip function??
Anyway I coudn't find it in any javascript ebook I've got nor in
msdn javascript refrence(I was worried if it's another IE's feature).
Can I use it freely everywhere and be sure it works fine on any browser?


 
Old April 27th, 2005, 11:41 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

As far as I know it's a Microsoft addition to JavaScript. You could implement it yourself.

--

Joe (Microsoft MVP - XML)
 
Old May 3rd, 2005, 07:35 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Actually, it's part of ECMAScript 3rd Edition, along with encodeURI, decodeURI, and decodeURIComponent. Be careful, because encodeURI and encodeURIComponent act differently: encodeURI won't encode question marks (?), equals(=), or ampersands (&); encodeURIComponent encodes everything in a URL.


Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
 
Old May 7th, 2005, 06:34 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Unusually :) the Microsoft documentation is wrong on this as it does not appear in the list of ECMAScript methods in the MSDN library. I'm glad it is standardised though, do any other browsers support it besides IE 5.5 and greater?

--

Joe (Microsoft MVP - XML)
 
Old May 7th, 2005, 06:50 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Okay, I looked at Nicholas C. Zakas' book as mentioned in his post above and according to that it's available in modern mozilla style browsers as well as IE.


--

Joe (Microsoft MVP - XML)
 
Old May 8th, 2005, 06:57 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You got it. Most modern browsers support it. I believe that IE 5.5 was the last to implement it.

It's always fun to check out ECMA-262 for more details: http://www.ecma-international.org/pu...s/Ecma-262.htm

Lots of good information in there if you can slog through it. It's a bit wordy and can be hard to follow at times, but it definitely gives you good insight into JavaScript.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
function keyvanjan ASP.NET 2.0 Professional 1 September 19th, 2007 10:22 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
need help for function mohiddin52 Access 2 June 8th, 2005 01:47 PM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.