Created
July 19, 2014 07:59
-
-
Save cycold/6b61751b381a819046ed to your computer and use it in GitHub Desktop.
comon js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onclick="loadPanel(this,{'name':'er','age':'12'})" | |
json = {'name':'er','age':'12'} //输出直接就是jsond对像 | |
onclick='loadPanel(this,"{\"name\":\"er\"}")' | |
json = "{\"name\":\"er\"}") //输出是json字符串 | |
function loadPanel(obj,json){ | |
console.log(json); | |
var json = eval('(' + json + ')'); | |
console.log(json); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment