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 9251177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:37:53+00:00 2026-06-18T10:37:53+00:00

This is the code that currently I have, it works to the extent that

  • 0

This is the code that currently I have, it works to the extent that it finds data.success and launches the next page when the correct value is returned, what I am having trouble with is parsing some additional data and passing to local storage so I use it on the next page, e.g user id, user name etc

$.post(postTo,{email:value1 , password:value2, tag:tagvar} , 

            function(data) {

                //$('#output').html('inside');

                if(data.success == '1') {

                  $.mobile.changePage( "home.html", { transition: "flip"} );


                } else {

                    $('#output').html('Could not connect please try again');

                }

            },'json');

       return false;
    });

});

Here is the JSON returned from the request…

{"tag":"login","success":1,"error":0,"uid":"4fc3562b9a8369.38575999","user":{"name":"test","email":"test@test.ie","created_at":"2012-05-28 11:40:43","updated_at":null,"ac":"8","user_type":"1"}}

I really am unsure of how to parse properly and also how to use local storage.

Many Thanks

  • 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-18T10:37:55+00:00Added an answer on June 18, 2026 at 10:37 am

    If you want to see that data parsed, you can use this nifty online parser: http://json.parser.online.fr/

    From that point, you should be able to access and save whatever you need to (for example data.user.name).

    As for saving data into local storage, check out W3C manual on that subject. Example:

    ...
    
    if (typeof(Storage)!=="undefined") {
      localStorage.username = data.user.name;
    }
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have this useful code that I found elsewhere on StackOverflow: form.DrawToBitmap(bmp, new
I have an Entity in Code First Entity framework that currently looks like this:
I have trouble finding way to correctly refactor this code so that there would
There is currently this Prototype code that does a PUT: new Ajax.Request(someUrl, { method:
In this code that uses the mongodb-native driver I'd like to increase the value
I have this code that I've edited: http://pastebin.com/vrqHek6S I've put in comments where I
I have this code that runs but never stops. class A { public static
I have this code that reads from XML file. It gets five strings (groupId,
I have a piece of code that works in a background process which looks
I have a bit of javascript that finds a link on the page and

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.