JAVASCRIPT:
function jsonDecode(data){
return (new Function("return " + data))();
}
其他要想实现类似的eval的功能,一般都是在 DOM中创建一个script节点,然后script.text = data;
-
$. ajax ( {
-
url: '/push/' + ( new . Date ( ) ) . getTime ( ) . toString ( 16 ) ,
-
type: 'GET' ,
-
beforeSend: function ( R ) {
-
R. setRequestHeader ( 'Connection' , 'Keep-Alive' ) ;
-
}
-
} ) ;
- juqrey parese json
function jsonDecode(data){
return (new Function("return " + data))();
}
其他要想实现类似的eval的功能,一般都是在 DOM中创建一个script节点,然后script.text = data;