Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:17:55+00:00 2026-05-26T15:17:55+00:00

I know this has been asked a few times but please bear with me.

  • 0

I know this has been asked a few times but please bear with me.

I have a google maps object which is rather complex (it contains various nodes, coordinates, etc) and I am trying to pass it as a query string.

I need a play javascript/jQuery solution.

I have tried the .param method which gives a jQuery error. The only thing that works is the “stringify” method which then creates a string that when appearing as a url looks a bit like this: %7B%5C”shape_1%5C”%3A%7B%5C”color%5C”%3A%5C”%237F0000%5C”%2C%5C”data%5C”%3A%7B%5C”b%5C”%3A%5B%7B%5C”Na%5C”%3A51.56727431757122%2C%5C”Oa%5C”%3A-0.10462402858888709%7D%2C….

php translates that as:
{\\”shape_1\\”:{\\”color\\”:\\”#7F0000\\”,\\”data\\”:{\\”b\\”:[{\\”Na\\”:51.56727431757122,\\”Oa\\”:-0.10462402858888709},…

but having said that I don’t want to use PHP, I am just showing you what it does in case it helps you see what stringify did to the object.

After I unescape with Javascript it looks a bit more normal like:

{\”shape_1\”:{\”color\”:\”#7F0000\”,\”data\”:{\”b\”:[{\”Na\”:51.56727431757122,\”Oa\”:-0.10462402858888709},..

So as you can see, the unescaped sequence has these slashes everywhere.
When I try to evaluate that into a JSON object I get “Illegal token \”. The parse method also fails. I just can’t find any way to put this string back into the complex JSON object that it was.
I have looked online for various suggestions but they fail. I also don’t understand why stringify injects all these slashes which simply shouldn’t be there.
If anyone has an idea how to take that object, put it in a query string and then parse it back I would be very grateful.

Nick


Update:
The answer is this:

encodeURIComponent(JSON.stringify(myObject));

And then on the receiving end:

var a = querySt("data");
var b = decodeURIComponent(a);
var c = unescape(b);
var d = JSON.parse(c);

or all in one line

JSON.parse(unescape(decodeURIComponent(querySt("data"))));

Nick

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:17:55+00:00Added an answer on May 26, 2026 at 3:17 pm

    See http://php.net/manual/de/security.magicquotes.php – you have to turn off magic quotes. They are old, deprecated stuff, they are insecure and break stuff.

    Magic Quotes is a process that automagically escapes incoming data to the PHP script. It’s preferred to code with magic quotes off and to instead escape the data at runtime, as needed.

    Howto: http://www.php.net/manual/de/security.magicquotes.disabling.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked a few other times but I have
I know this has been asked a lot of times, but I have honestly
Now I know this has been asked a few times, but i'm still not
I know this has been asked a few times here. But none of the
I know this has been asked a few times, but I can't find a
I know this question has been asked here a few times before. But i
I know this question has been asked quite a few times, however, I have
I know this kind of question has been asked a few times, but alot
I know this questions has been asked a few times here. But these seem
I know this has been asked a few times before, but the existing solutions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.