Page 1 of 3
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Mon Jun 10, 2013 11:18 pm
by John Herdean
Im getting a json service response and mapping an id to a local storage item. Then Im mapping that local storage item to a request parameter attached to a different json service, but it seems that its either not storing the value or not getting the value or both. I thought I can just map the items.... Is that correct? or do I need to attach JS code in order to make this work?
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:18 am
by John Herdean
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:21 am
by John Herdean
the error above represents that an invalid 'id' was sent to the server and the server returned an error. therefore, i did not save and/or send to the server in the request parameter a valid 'id'. The storing and retrieving of the 'id' value is not passing.
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:25 am
by John Herdean
the next thing i tried was to add JS code to the incoming and outgoing items as follows:
JS for storing in the local storage Item:
localStorage.setItem('id',g);
JS for getting from the local storage Item:
var g=localStorage.getItem('id');
return g;
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:26 am
by John Herdean
the JS did not work either
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:27 am
by John Herdean
Ok, so can I get some help here? Thanks...
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:52 am
by Illya Stepanov
Hi John - as you are receiving a response from the server, first of all check if you are receiving correctly an 'id' field.
As I can see on a screenshot above you getting an "400 Bad request" - that means that the request you sent to the website server was somehow malformed therefore the server was unable to understand or process the request.
The most common reason for a 400 Bad Request error is because the URL was typed wrong or something wrong with URL.
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:56 am
by John Herdean
I have already tested this service and works perfect when i manually enter it in...
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 12:58 am
by John Herdean
see below my success when i do a manual test on that service:
Do I Need any JS Code to store any values to Local STorage if Im already mapping?
Posted: Tue Jun 11, 2013 1:01 am
by John Herdean
this is what happens when theres no id value: