facebook - Blogger - How to Percent Encode an URL / Escape It to Use as Query Param? -


in blogspot template engine how escape post url use query param can use in facebook / twitter / whatever buttons , iframes?

problem: have iframe src takes url.

<iframe src="https://www.facebook.com/plugins/like.php?href=my_url_goes_here"> 

so post url http://example.blogspot.com/1999/01/first.html. need convert :/. percent encoded characters, , ?&% etc. otherwise this:

<iframe src="https://www.facebook.com/plugins/like.php?href=http://example.blogspot.com/1999/01/first.html"> 

and looks it's going break someday. how can escape url in blogger?

the way pretty simple , takes wasting couple of hours searching every corner of internet semblance of documentation on blogspot's template engine , reading through bunch of stackoverflow's answer dismiss question "use shareurl instead."

anyway. every string in blogspot templates has .escaped field string escaped. it. anyurl.escaped , works. can data:post.url.escaped or data:post.url.canonical.escaped or whatever.

<iframe   expr:src="&quot;https://www.facebook.com/plugins/like.php?href=&quot;     + data:post.url.canonical.escaped + &quot;width=173&amp;layout=button_count&amp;action=like&amp;size=small&amp;show_faces=false&amp;share=true&amp;height=46&amp;appid=your_app_id_here&quot;" width="173" height="46" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowtransparency="true"></iframe> 

other elusive string attributes can found in extremely fishy blog: http://template-data.blogspot.com.br/2016/04/title_58.html

you'd think google have info somewhere easy find got blogger http api docs? what?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -