Posted By

Piotrek290 on 10/26/09


Tagged

url javascript Converter json


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

nerdfiles
Piotrek290


Form json to url


 / Published in: JavaScript
 

  1. var JSON = {
  2. parms : function(a1){t=[];for(x in a1)t.push(x+"="+encodeURI(a1[x]));return t.join("&");}
  3. };
  4.  
  5.  
  6. // EXAMPLE
  7. var object = {
  8. 'parm1' : 'val1',
  9. 'parm2' : 'val2',
  10. 'parm3' : 'val3'
  11. };
  12.  
  13. var con = JSON.parms(object); // return: parm1=val1&parm2=val2&parm3=val3

Report this snippet  

You need to login to post a comment.