Omar Tariq
Omar Tariq

Reputation: 7724

Query String Parameter 'URL' Containing URL with a Query String

In context to the answer of 'Alo Sarv' at this question:-

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

I'm facing a problem.

How can I achieve this:-

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

Such that siteA_URL is

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

and not:-

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

Upvotes: 0

Views: 172

Answers (1)

johnnycardy
johnnycardy

Reputation: 3046

You need to correctly encode the URL parameter:

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

Upvotes: 1

Related Questions