3

Hi I have this URL (top) I'm trying to use with "pinterest" they change the url (bottom). Does anybody know how I can change my (top) url to be the same as the "pinterest" url. Is there a Jquery plugin? or somthing like (decodeURIComponent)??? Maybe there is nothing other than using .replace. I thought I would ask first. Thanks

 http://my.site.com/folder/shadez/zoom.php?returntype=2&size=small&images[]=Base.jpg&images[]=Frame_Clear.png&images[]=Left_Clear.png&images[]=Right_Clear.png&images[]=Lenses_Lenses-Semi-Clear.png

 http%3A%2F%2Fmy.site.com%2Ffolder%2Fshadez%2Fzoom.php%3Freturntype%3D2%26size%3Dsmall%26images%5B%5D%3DBase.jpg%26images%5B%5D%3DFrame_Clear.png%26images%5B%5D%3DLeft_Clear.png%26images%5B%5D%3DRight_Clear.png%26images%5B%5D%3DLenses_Lenses-Semi-Clear.png
2
  • 1
    Close - you're looking for encodeURIComponent. Commented Aug 13, 2013 at 2:54
  • Cool thanks Matt, works!! Commented Aug 13, 2013 at 2:57

1 Answer 1

0

You can use the encodeURIComponent & decodeURIComponent function of javascript.

 encodeURIComponent(uour_url)

 decodeURIComponent(encoded_uri)

Check this http://jsfiddle.net/aGQFK/1/

Sign up to request clarification or add additional context in comments.

1 Comment

encodeURIComponent should generally be preferred over encodeURI. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.