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

  • Home
  • SEARCH
  • 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 9142619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:49:23+00:00 2026-06-17T09:49:23+00:00

Perhabs this questions should be named: How to animate jQuery-objects through hash . Howsoever…

  • 0

Perhabs this questions should be named: How to animate jQuery-objects through hash.

Howsoever… How can I convert a string into an object? I’ve tried JSON.parse and $.parseJSON but get the following error-message: Uncaught SyntaxError: Unexpected token t.

What I try to accomplish: I want to animate jQuery objects through a hash.

Here’s my current state (Maybe there’s a better way? Then tell it to me!):

var params = (location.hash || '#').substr(1).split('|');
$.map(params, function (e) {
    var parts = e.split('=');
    $(parts[0]).animate(parts[1]);
    console.log(typeof parts[1]); // 2 `string`
});

Use this fiddle and attach these hash to the url:

##foo={top:100,left:100}|#bar={top:100,right:100}

(Sorry markdown doesn’t allow me to append this kind of hash directly to the link).

  • 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-06-17T09:49:24+00:00Added an answer on June 17, 2026 at 9:49 am

    Your JSON isn’t valid. (Paste it into http://jsonlint.com/ and see for yourself.)

    JSON is stricter than JavaScript syntax and requires quoted object keys:

    ##foo={"top":100,"left":100}|#bar={"top":100,"right":100}
    

    If you put quotes around top, left, and right, then you can just use JSON.parse or $.parseJSON on the JSON strings directly.

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

Sidebar

Related Questions

This question has been asked before perhaps multiple times, but I can't get the
This should be a very basic question, I'm still new to ruby so i'd
This currently returns undefined. What should go in the commented line to alert the
I hope this isn't a duplicate; the other similar questions I read didn't help
Okay, i know there have been some questions about this before, but I just
[EDIT] Hmm. Perhaps this question should be titled what is the default user-input dialog
I am 80% sure I should not be asking this question because it might
Perhaps this question has been asked elsewhere, but I'm unable to find it. With
I have an ObjectDataSource (but perhaps this question is the same for all kinds
This question is just out of interest, and perhaps could be useful for my

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.