2014-01-10 49 views
0

在上下文中「ALO Sarv」的答案: -查詢字符串參數「網址」在這個問題包含URL與查詢字符串

Why is Facebook share button pulling parameters from the meta tags instead of my specified ones?

我面臨的一個問題。

我怎樣才能做到這一點: -

http://siteA.com?siteA_URL=http://siteB.com?siteB_title=abc&siteB_description=def&siteA_title=ghi&siteA_description=jkl 

這樣siteA_URL是

siteA_URL = http://siteB.com?siteB_title=abc&siteB_description=def 

,而不是: -

siteA_URL = http://siteB.com?siteB_title=abc 
+0

這是一個JavaScript的問題? – johnnycardy

回答

1

您需要正確編碼的URL參數:

var siteA_URL = encodeURIComponent("http://siteB.com?siteB_title=abc&siteB_description=def"); 
var url = "http://siteA.com?siteA_URL=" + siteA_URL;