Mattias
Mattias

Reputation: 3907

Get the correct url format to Facebook Sharer

I need to format a url passed to Facebook Sharer via AS3 using navigateToURL(new URLRequest(request), "_blank");.

The url that is passed has a lot of strange characters. What is the best way to get the correct output?

This works: http://www.facebook.com/sharer.php?u=www.somesiteurlthatdoesnotexist.com?title=This works fine

This does not work: http://www.facebook.com/sharer.php?u=www.somesiteurlthatdoesnotexist.com?title=Jag behöver fixa en url som funkar med åäl och & tecken

Upvotes: 0

Views: 1103

Answers (1)

Jonatan Hedborg
Jonatan Hedborg

Reputation: 4432

Try this:

escape("Jag behöver fixa en url som funkar med åäl och & tecken");

It should make it "URL encoded".

Upvotes: 1

Related Questions