导入js文件:https://files.cnblogs.com/yangyh/json2.js

function Person(name,age,birthday){
this.Name = name;
this.Age = age;
this.Birthday = birthday;
}

var p = new Person("test测123",20,new Date());

var output = JSON.stringify(p);
var url = '('+output+')';
alert(output);
var outP = eval('('+output+')');
e = encodeURIComponent(output)
alert(e);
document.write('Name:'+outP.Name+'<br />')
document.write('Age'+outP.Age+'<br />')
document.write('Birthday'+outP.Birthday)
window.location.href = "t1.html?p="+url;



t1.html:

t=decodeURIComponent(getUrlPara('p'));
 alert(eval(t).Name);


 

 

相关文章:

  • 2022-12-23
  • 2021-03-31
  • 2021-07-17
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案