var areaId = parseInt (top.Util.getURLParameter("areaId",backUrl)==""?0:top.Util.getURLParameter("areaId",backUrl),10) ; var focusId = parseInt (top.Util.getURLParameter("focusId",backUrl)==""?0:top.Util.getURLParameter("focusId",backUrl),10) ;这个
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 03:43:03
var areaId = parseInt (top.Util.getURLParameter("areaId",backUrl)==""?0:top.Util.getURLParameter("areaId",backUrl),10) ; var focusId = parseInt (top.Util.getURLParameter("focusId",backUrl)==""?0:top.Util.getURLParameter("focusId",backUrl),10) ;这个
var areaId = parseInt (top.Util.getURLParameter("areaId",backUrl)==""?0:top.Util.getURLParameter("areaId",backUrl),10) ;
var focusId = parseInt (top.Util.getURLParameter("focusId",backUrl)==""?0:top.Util.getURLParameter("focusId",backUrl),10) ;
这个是EPG页面的代码.
var areaId = parseInt (top.Util.getURLParameter("areaId",backUrl)==""?0:top.Util.getURLParameter("areaId",backUrl),10) ; var focusId = parseInt (top.Util.getURLParameter("focusId",backUrl)==""?0:top.Util.getURLParameter("focusId",backUrl),10) ;这个
//从URL上获取一个areaId的参数
top.Util.getURLParameter("areaId",backUrl)
//这是一个三目运算,获取的areaId如果为空则返回0,否则返回areaId
top.Util.getURLParameter("areaId",backUrl) == "" ? 0 : top.Util.getURLParameter("areaId",backUrl)
//用parseInt()方法解析areaId,返回一个整数
parseInt (top.Util.getURLParameter("areaId",backUrl)==""?0:top.Util.getURLParameter("areaId",backUrl),10)
你给的这两段代码作用是一样的
总结一下就是:
获取一个url上的参数,并转换成整数,如果此参数为空,则返回一个0.