87,993
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
function jsonhandle(result){
alert("k");
var json = result;
alert(json);
}
jsonhandle("aa");
$_c={};
$_c.jsonaa = function(options){
var result_01 = json;// 这里不能使用 jsonhandle("aa") 函数 ,不能使用全局变量
}
</script>
<body>
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
$_c={};
$_c.aa = function(aca)
{
alert(aca);
}
$_c.aa("测试a=a");
for(var i=0; i<10; i++)
{
localStorage.setItem(i,i);
}
for(var i=0; i<10; i++)
{
var a =localStorage.getItem(i);
//alert(a);
}
function jsonhandle(result){
// alert("k");
var json = result;
localStorage.setItem("json", json);
alert("json=="+json);
}
jsonhandle("aa");
$_c.jsonaa = function(options){
var result_01 =localStorage.getItem("json");
alert("result_01=="+result_01);
}
$_c.jsonaa(1);
</script>
</body>
</html>
function jsonhandle(result){
jsonhandle.json = result;
}
jsonhandle("aa");
$_c={};
$_c.jsonaa = function(options){
var result_01 = jsonhandle.json;// 这里不能使用 jsonhandle("aa") 函数 ,不能使用全局变量
}