Solved a bug today whilst encoding in JavaScript a URL that contained a certain special character: the hash character #.
I found a generated querystring was not working correctly because many of the params were not being passed to the server somehow. I was generating a link like so: var link = 'http://www.britishdeveloper.co.uk?link=' + encodeURI(url) + '&userID=232';
I was quite pleased with myself remembering to URL Encode params that are going into a querystring to get around special characters but I had not thought of something... the hash character #!
Say the url being placed in the querystring is '/my page.aspx#comment3'
my link was coming out as http://www.britishdeveloper.co.uk?link=/my%20page.aspx#comment3&userID=232
.
What's wrong with that?
Well it's not what I was expecting really but it was working up until I got urls with hashes in. As you may or may not know everything proceeding a # in a url is for browsers so your server will ignore everything after it. In this case the userID param was not seen by my server.
encodeURIComponent not encodeURI
For this particular scenario encodeURIComponent was what I needed since:
encodeURI('/my page.aspx#comment3') //output: /my%20page.aspx#comment2 encodeURIComponent('/my page.aspx#comment3') //output: %2Fmy%20page.aspx%23comment2
encodeURI is for encoding non-URI special characters from a string so the above example of encodeURI would have been great for appending it like so 'http://www.britishdeveloper.co.uk' + encodeURI(url)
encodeURIComponent is for encoding a string to be fit for a querystring param where characters such as . and # shouldn't really be included as in my above example.
So know your Javascript encoding!
Excellent read, I just passed this onto a colleague who was doing a little research on that.
ReplyDeletehow to write dissertation abstract
The effectiveness of IEEE Project Domains depends very much on the situation in which they are applied. In order to further improve IEEE Final Year Project Domains practices we need to explicitly describe and utilise our knowledge about software domains of software engineering Final Year Project Domains for CSE technologies. This paper suggests a modelling formalism for supporting systematic reuse of software engineering technologies during planning of software projects and improvement programmes in Final Year Projects for CSE.
DeleteSoftware management seeks for decision support to identify technologies like JavaScript that meet best the goals and characteristics of a software project or improvement programme. JavaScript Training in Chennai Accessible experiences and repositories that effectively guide that technology selection are still lacking.
Aim of technology domain analysis is to describe the class of context situations (e.g., kinds of JavaScript software projects) in which a software engineering technology JavaScript Training in Chennai can be applied successfully
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Very useful. Helped me solve exactly the same issue with "#" not encoding. Thanks
ReplyDeleteBrowsers are tooooo much clever this days. They catch my '#' even while it encoded to %23.
ReplyDeletePest Control services in Kirti Nagar
ReplyDeletePest Control services in Modi Nagar
Pest Control services in Patel Nagar
Pest Control services in Rajouri Garden
Pest Control services in Tilak Nagar
Pest Control services in Janakpuri
Pest Control services in Paschim Vihar
This is really awesome...I like your post and looking forward to it.Blackmart Apk free download market helper latest version freestore apk latest version
ReplyDeleteIndia's only Digital News Channel with True Voice of India.
ReplyDeleteFinding #Championsofchange2018 #rahulshivkant
the universal post teams
the universal post youtube
loksabha election 2018
top trending news
top viral news
best trending news in india
Hello, I log on to your blogs on a regular basis. Your writing style is witty, keep it up!
ReplyDeleteMenmyshop
Touch Hypersonic Double Din Player Mirror
J3L Touch Double Din Player
Hypersonic Double Din Player Mirror
J3L Double Din Player Mirror
Hyundai Xcent OEM Double Din Player
banzara
Movers and packers in mohali
ReplyDeletePatrachar Vidyalaya Admission Form
Patrachar Vidyalaya Shalimar Bagh
Open School admission
Cbse Patrachar
packer and mover chandigarh
ReplyDeletePackers and movers in panchkula
packers and movers in mohali
Thanks for your post! Through your pen I found the problem up interesting! I believe there are many other people who are interested in them just like me!
ReplyDeleteGeometrydashonline.net
Basketballlegendsgame.com
Nice Article
ReplyDeleteAbb Sockets Online
Industrial Plug Sockets online
Abb Switches Online
Abb Mounting Plates Online
Abb Manual Changeover Switches Online
Nice Article
ReplyDeleteBest Doctors in Faridabad
Best Doctors in Gurugram
Best Doctors in Ghaziabad
Best Doctors in Noida
Best Doctors in Delhi
Motifz Designer Lawn. 1, 2 & 3 Piece Unstitched Premium Embroidered Lawn 2019, Premium Lawn, Lawn 2019, Best lawn collection, Motifz, Best Lawn in Pakistan, Shipping worldwide. Stitching option available.
ReplyDeleteBy reading the article material very very well and this is very useful.
ReplyDeletecara menggugurkan hamil
penyebab telat haid dan solusinya
aktivitas penyebab keguguran
tanda tanda kehamilan
kalkulator masa subur wanita
masa subur wanita
Buy Premium lawn Online for Women's at best prices available at Motifz. ✓ Latest Fashion, ✓ Trendy Designs ➤ Shop Now!
ReplyDeletePackers and Movers Bangalore as a Services providing company can make all the difference to your ###Home Relocation experience. Bangalore based Company which offers versatile solutions, Right team that easily reduce the stress associated with a ???Household Shifting, ***Vehicle Transportation. we help things run smoothly and reduce breakages and offer you seamless, Affordable, Reliable Shifting Services, Compare Shifting Charges
ReplyDeletePackers And Movers Bangalore
This is really unbelievable and extraordinary work. Everyone should read. Thanks for sharing and don't miss WORLD'S BEST
ReplyDeleteBikeGame
Hire Best Packers And Movers Mumbai for hassle-free Household Shifting, ***Office Relocation, ###Car Transporation, Loading Unloading, packing Unpacking at affordable Price Quotation. Top Rated, Safe and Secure Service Providers who can help you with 24x7 and make sure a Untroubled Relocation Services at Cheapest/Lowest Rate @ Packers And Movers Mumbai
ReplyDeletePackers And Movers Bangalore Local Household Shifting Service, Get Free Best Price Quotes Local Packers and Movers in Bangalore List, Compare Charges, Save Money And Time at
ReplyDeleteLocal Packers And Movers Bangalore
Packers and Movers Pune Provide High Quality ***Household Shifting, Home/Office Relocation, Insurance, Packing, Loading, ###Car Transportation Service Pune and High experiences, Top Rated, Safe and Reliable, Best and Secure Packers and Movers Pune Team List. Get ✔✔✔Affordable Rate Charts and Compare Quotation and Save Money and Time @
ReplyDeletePackers And Movers Pune
Packers And Movers Bangalore to Noida
ReplyDeletePackers And Movers Bangalore to Mumbai
Packers And Movers Bangalore to Ahmedabad
Packers And Movers Bangalore to Gurgaon
Packers And Movers Bangalore to Delhi
Packers And Movers Bangalore to Guntur
Packers and Movers Hyderabad Give Certified and Verified Service Providers, Cheap and Best ###Office Relocation Charges, ***Home Shifting, ✔✔✔Goods Insurance worth Rs. 10,000, Assurance for Local and Domestic House Shifting. Safe and Reliable Household Shifting Services in Hyderabad with Reasonable Packers and Movers Price Quotation @ Packers And Movers Hyderabad
ReplyDeletePackers and Movers Gurgaon Provide Reliable, Safe and Certified Service Provider list, Get Free ***Best Price Quotaition and Compare Charges. ???Hassle free Household Shifting Services, High Quality packing Material, Office Relocation, Car Transportaion, ###Local and Domestic Shifting Service @
ReplyDeletePackers And Movers Gurgaon
Get Shifting/Relocation Quotation from ###Packers and Movers Delhi. Packers and Movers Delhi 100% Affordable and Reliable ***Household Shifting Services. Compare Transportation Charges and Save Time, Verified and Trusted Packers and Movers in Delhi, Cheap and Safe Local, Domestic House Shifting @ Packers And Movers Delhi
ReplyDeleteNice post!..good information,it is really helpful..it really impressed me alot and i just loved it.Thanks for posting such an informative content:
ReplyDeleteLocal Packers And Movers Bangalore
Packers And Movers Bangalore to Bhubaneswar
ReplyDeletePackers And Movers Bangalore to Srinagar
Packers And Movers Bangalore to Haridwar
Packers And Movers Hyderabad Local Household Shifting Service, Get Free Best Price Quotes Local Packers and Movers in Hyderabad List , Compare Charges, Save Money And Time.@
ReplyDelete@ Packers And Movers Hyderabad
Wholesale printed custom perfume boxes with the highest quality and affordable prices. Free worldwide Delivery and free Custom Perfume Boxes design.
ReplyDeleteBuy online wholesale printed custom candle boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!
ReplyDeletePackers and Movers Chennai list, Cheap Best Packers Movers Chennai Charges, Local, Affordable Household Shifting Chennai @ Packers And Movers Chennai
ReplyDeleteWe Provide Local Packers And Movers Pune List for Get Best Price Quotes, Compare Charges, Save Money And Time, Top Household Shifting Services @ Packers And Movers Pune
ReplyDeletean awesome blog thanks a lot for giving me this great opportunity to write on this.please visit our website I assure you that it will be very useful for you @ Packers and Movers Kolkata
ReplyDeletePackers and Movers Chennai list, Cheap Best Packers Movers Chennai Charges, Local, Affordable Household Shifting Chennai @ Packers And Movers Chennai
ReplyDeleteLovely Website, Maintain the fantastic work. Thank you so much!
ReplyDeleteLocal Packers and Movers Mumbai list, Cheap Packers Movers Mumbai Charges, Affordable, Best Household Shifting Mumbai @ Packers and Movers mumbai
Buy online wholesale custom cosmetic boxes and packaging at seashore packaging at the easy price Free shipping worldwide with 24/7 customer support.
ReplyDeletePackers and Movers Ahmedabad list, Cheap Packers Movers Ahmedabad Charges, Local, Affordable Household Shifting Ahmedabad @ Packers and Movers Ahmedabad
ReplyDeleteGet Packers and Movers Jaipur List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Jaipur Price Quotation instantly and Save Cost and Time. Packers and Movers Jaipur ✔✔✔Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @ Packers And Movers Jaipur
ReplyDeletePackers and Movers Chennai Give Safe and Reliable ***Household Shifting Services in Chennai with Reasonable ###Packers and Movers Price Quotation. We Provide Household Shifting, Office Relocation, ? ? ? Local and Domestic Transportation Services, Affordable and Reliable Shifting Service Charges @ Packers And Movers Chennai
ReplyDeletePackers And Movers Gurgaon to Haridwar
ReplyDeletePackers And Movers Gurgaon to Noida
Packers And Movers Gurgaon to Guntur
Packers And Movers Gurgaon to Muzaffarpur
Blackbird packaging provide you with any size, shape design, lipstick boxes sooner than any other packaging competitor in the market
ReplyDeletePackaging town is a one-stop solution for the short-run Custom Packaging, Wholesale cream Boxes needs, and supplies at ease.
ReplyDeletemylar label bags in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available
ReplyDeleteAn excellent information provided thanks for all the information i must say great efforts made by you. thanks a lot for all the information you provided
ReplyDeletePackers And Movers Jaipur
Blackbird packaging provide you with any size, shape design, game boxes wholesale sooner than any other packaging competitor in the market
ReplyDeletehttps://www.guest-articles.com/education/how-to-pass-gaqm-iso-iec-li-exam-on-first-try-10-12-2020
ReplyDeleteI am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post.
ReplyDeleteClick Here to Get More Sites
Packers and Movers mumbai
Packers And Movers Ahmednagar Maharashtra
Packers And Movers Mumbai to Chennai
The TOP 4 Movers and Packers Pune are expert in their work. They offer top-notch and door-to-door moving services for your home, office, domestic, national or vehicle transportation. We have experience to handle and execute all types of relocation services. @ Packers and Movers Pune
ReplyDeletecustom printed mylar bags UK in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available
ReplyDeletei like your post watch online indian dramas full episodes hd..
ReplyDeleteQurbaan Hua
Kundali Bhagya
Packers And Movers Hsr Layout Bangalore
ReplyDeletePackers and Movers Whitefield Bangalore
Packers and Movers JP Nagar Bangalore
Packers And Movers Mohali
buy pret wear 2021 online from afrozeh
ReplyDeletecoffee maker
ReplyDeleteShop for Electronic Goods at Al-Fatah, Pakistan's leading chain of departmental stores. Shop from a huge range of top brands Home Appliances, Smart-tech and Phones and Sound bars from Al-Fatah. Shop from huge range of electronics available at Al-Fatah. Avail Free Delivery on orders above 1000 PKR in selected cities.
buy lahore electronics from alfatah at best prices. get free shipping
ReplyDeletebuy online men zipper hoodie online from wild goat clothing at best prices. Get Free shipping
ReplyDeleteExplore the profiles of guwahati escorts, guwahati call girls, call girls in guwahati
ReplyDeleteand escorts in guwahati for female companionship in top rated hotels.
Get affordable escort services in guwahati hotels now.
College escorts in Guwahati |
Housewife escorts in Guwahati |
Assamese call girls in Guwahati |
Nepali call girls in Guwahati |
High profile escorts in Guwahati |
Russian escorts in Guwahati |
College call girls in Guwahati |
Call girl service in Guwahati |
Independent call girls in Guwahati
Independent escorts in Guwahati
Hello, This is a Nituroy.com very interesting blog. this content is written very well This is an amazing
ReplyDeletepost, keep blogging.thanks for sharing.
Assamese call girls in guwahati
College escorts in guwahati
Housewife escorts in Guwahati
Nepali escorts in Guwahati
High profile escorts in Guwahati
Escort services in Guwahati
Independent escorts in Guwahati
Maybe you are also looking for the right person to ensure the higher quality
ReplyDeletesex and that’s why you are in this place because here we are going to share
the data and information of Guwahati Escorts.
Escort services in Guwahati
Call Girl services in Guwahati
If you are frustrated in your life and looking for some changes, then it's high time.Make a plan and travel to Guwahati escort
ReplyDeleteand choose here Guwahati call girl service. It will remove your tension from life and make your life smooth.
Assamese call girls in Guwahati
College escorts in Guwahati
Housewife escorts in Guwahati
Nepali escorts in Guwahati
Escort services in Guwahati
I really loved your post so much that I cant resist writing comment...Please check mine as well
ReplyDeleteEscort services in Bhubaneswar
Call girl services in Bhubaneswar
Do your grocery at Al-Fatah, Pakistan's best and largest grocery online in lahore website. Shop from a wide range of grocery including oil and ghee, tea and coffee, dry fruits and seeds, dairy and fresh bakery items, packaged foods, snacks and beverages, baby care, household essentials, fruits and vegetables and many more.
ReplyDeleteBlackbird packaging provide you with any size, shape design, custom bottle neckers wholesale sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging provide you with any size, shape design, custom bottle neckers wholesale sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging company can provide you with any size, shape design, and cookie packaging boxes sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging provide you with any size, shape design, cookie packaging boxes sooner than any other packaging competitor in the market
ReplyDeletebuy bath bomb packaging online from Blackbird Packaging at best prices. Get free shipping
ReplyDeletePackaging town is a one stop solution for the short-run custom soap boxes needs and supplies. At affordable prices. Request a free quote now.
ReplyDeleteBlackbird packaging company can provide you with any size, shape design, and cookie packaging wholesale sooner than any other packaging competitor in the market
ReplyDeleteThanks for sharing information with us…satisfied after visiting your blog…. Learn the latest trends & their practical application by experts with us…you can contact us click on
ReplyDeleteVisit ISMT India
buy hair supplements in pakistan in pakistan from medisense at best prices. Get free shipping
ReplyDeleteThanks for sharing information with us…satisfied after visiting your blog… Prepare for CAT, CMAT, MHCET, GRE, GMAT, SAT, CLAT, MHCET Law, BBA IPM with our live online courses. To visit us, click on link
ReplyDeleteVisit Career Managers
buy baby food online from medisense.pk at best prices delivered at your doorstep. get free shipping
ReplyDeletebuy gym bags for girls online from Dshred at easy prices delivered at your doorstep. Get free shipping
ReplyDeletebuy dental care products at best prices from medisense delivered at your doorstep. Get free delivery
ReplyDeletebuy hair supplements in pakistan from Medisense.pk delivered at your doorstep at best prices. Get free shipping
ReplyDeletebuy active wear for women online from Dshred at best prices delivered at your doorstep. Get free shipping
ReplyDeletebuy tank tops for men online from dshred at easy prices delivered at your doorstep.get free shipping.
ReplyDeletebuy makeup in pakistan from alfatah at best prices delivered at your doorstep. get free delivery
ReplyDeletebuy skin care products in pakistan online from medisense at best prices deloivered at your doorstep. get free shipping
ReplyDeleteBuy buy multivitamins online pakistan at easy prices from medisense delivered at your doorstep. Get free shipping
ReplyDeleteBuy online medicine in lahore at affordable prices from medisense delivered at your doorstep. Get free shipping.
ReplyDeleteBuy men's care at easy prices from medisense delivered at your doorstep. Get free shipping.
ReplyDeletebuy sports tshirts online from dshred at easy prices delivered at your doorstep. get free shipping
ReplyDeletebuy home wear online from Dshred at best prices delivered at your doorstep. get free shipping
ReplyDeletebuy reflective vest online from Dshred at best prices delivered at your doorstep. get free shipping
ReplyDeleteNeed comfortable trousers for men? The wait is over because we have got the best men's trousers to range only at Ndure. Just log onto our site to avail the best trousers made in Pakistan. We guarantee that you will not regret it. Breathable fabric, comfortable designs are going to be with you every second.
ReplyDeleteStudy Engineering at the best autonomous college in AP with scholarships and full faculty support with high quality education and professional career support.
ReplyDeletehttps://www.adityatekkali.edu.in/
From Reign you can buy the latest Lawn Collection at best price and enjoy free home delivery.
ReplyDeleteBuy the latest luxury pret collection from Reign and enjoy the best price with free home delivery.
ReplyDeleteBuy the latest Organza Collection 2021 from Reign and enjoy the best price with free home delivery.
ReplyDeleteBuy the latest Chiffon Collection from Reign and enjoy the best price with free home delivery.
ReplyDeleteBuy the latest Embroidered Lawn Collection from Reign and enjoy the best price with free home delivery.
ReplyDeleteBuy the latest pret lawn from Reign and enjoy the best price with free home delivery.
ReplyDeleteFrom Reign you can buy the latest Online Organza Collection at best price and enjoy free home delivery.
ReplyDeleteBuy the latest Embroidered Chiffon Collection 2021 from Reign and enjoy the best price with free home delivery.
ReplyDeletebuy gym wear online in Pakistan from dshred at easy prices delivered at your doorstep. Get free shipping
ReplyDeletebuy electronics online in lahore from Al-Fatah at best prices delivered at your doorstep. Get free shipping
ReplyDeletebuy tank tops for girls online from Dshred at easy prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy online grocery from Al-Fatah at best prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy men clothing online from Al-Fatah at best prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy quilt cover sets Online in Australia from Bulbul Home.
ReplyDeleteChoosing a bridal dress is a matter of extreme significance for the bride. Visit Highway Fashion And Choose the best.
ReplyDeleteDiscover the latest trends in clothing from zara man Pakistan available now at Enem Mall. Find the best Zara Men online today.
ReplyDeleteBuy comfortable night dress for girls online in Pakistan from Enem Mall.
ReplyDelete
ReplyDeleteECS is offering the best dresses for girls to make their collections fashionable. ECS fabrics are premium quality which make your outfit fancy.