js Uncaught ReferenceError: xianyouwangwangshuchu is not defined这个错误?

20:51 提问
js:Uncaught referenceError:alertWin is not defined
没有请求ajax的时候是正常的。
&script type="text/javascript" src="jquery-1.10.2.js"&
function alertWin(Cno)
var msgw,msgh,titleheight,bordercolor,
msgw = 300;//提示窗口的宽度
msgh = 300;//提示窗口的高度
titleheight = 25 //提示窗口标题高度
bordercolor = "#A480B2";//提示窗口的边框颜色
titlecolor = "#A480B2";//提示窗口的标题颜色
//根据自己需求注意宽度和高度的调整
var iWidth = document.documentElement. clientW
var iHeight = document.documentElement.clientH
var bgObj = document.createElement("div");
bgObj.setAttribute("id", "bgObj");//设置ID
bgObj.style.cssText = "position:left:0top:0width:"+iWidth+"height:"+Math.max(document.body.clientHeight, iHeight)+"filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;";
document.body.appendChild(bgObj);
//弹出窗口
var msgObj=document.createElement("div");
msgObj.setAttribute("id", "msgDiv");//可以用bgObj.id="msgDiv"的方法,是为div指定属性值
msgObj.setAttribute("align", "center");//为div的align赋值
msgObj.style.background = "white";//背景颜色为白色
msgObj.style.border = "1px solid " +//边框属性,颜色在上面已经赋值
msgObj.style.position = "absolute";//绝对定位
msgObj.style.left = (iWidth-msgw)/2//从左侧开始位置
msgObj.style.top = (iHeight-msgh)/2;//从上部开始位置
msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";//字体属性
msgObj.style.width = msgw + "px";//提示框的宽(上面定义过)
msgObj.style.height = msgh + "px";//提示框的高(上面定义过)
msgObj.style.textAlign = "center";//文本位置属性,居中。
msgObj.style.lineHeight = "25px";//行间距
msgObj.style.zIndex = "102";//层的z轴位置
document.body.appendChild(msgObj);
//弹出窗口标题
var title = document.createElement("div");//创建一个标题对象
title.setAttribute("id", "msgTitle");//为标题对象填加id
title.style.margin = "0";//浮动
title.style.padding = "3px";//浮动
title.style.background =//背景颜色
title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity = "0.75";//透明
//title.style.border="1px solid " +//边框
title.style.height = "25px";//高度
title.style.font = "12px Verdana, Geneva, Arial, Helvetica, sans-serif";//字体属性
//title.style.color = "red";//文字颜色
title.style.cursor = "move";//鼠标样式
type:"post",
url:"ShowDetail?Cno="+Cno,
dataType:"json",
success:function(data){
},error:function(){
alert("请求出错");
title.innerHTML="&table border='0' width='100%'&&tr&&td align='center'&收银小票单&/td&&td align=\"right\"&&a href='#' onclick='closeDiv()'&关闭&/a&&/td&&/tr&&tr&&td align='center'&时间:&/td&&/tr&&tr&&td align='left'&三得利青柠水&/td&&/tr&&/table&";
msgObj.appendChild(title);//在提示框中增加标题
//添加关闭功能
function closeDiv()
var msgTitelObject = document.getElementById("msgDiv");
document.body.removeChild(msgTitelObject);
var bgObj = document.getElementById("bgObj");
document.body.removeChild(bgObj);
按赞数排序
你的ajax请求代码后面还有其他的代码 title.innerHTML=,但是ajax请求默认是异步的。
试试ajax请求天津async:false参数。
粗看ajax写法上没什么问题,括号逗号都匹配。可以用浏览器调试看看函数内部报没报错
另外,看调用方法的地方是不是有问题
试试ajax请求添加参数async:false,或者把ajax请求后面的代码放在success回调函数中。
倒入的js文件和内嵌js代码块不用共用一个script标签,要分开
&script type="text/javascript" src="jquery-1.10.2.js"&&/script&
function alertWin(Cno)
var msgw,msgh,titleheight,bordercolor,
msgw = 300;//提示窗口的宽度
msgh = 300;//提示窗口的高度
...........................
7545关注|1202收录
242关注|147收录
3342关注|199收录5044人阅读
Web开发(12)
经验(19)
JavaScript(9)
使用Chrome浏览器的开发人员工具的Console面板查看JS错误日志时,总是提示如下信息:“Uncaught ReferenceError: xl_chrome_menu is not defined”。是因为在Chrome浏览器中安装了迅雷下载支持插件的原因,卸载或停用之后就不会有这个错误提示了。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:63956次
积分:1034
积分:1034
排名:千里之外
原创:45篇
评论:12条
(2)(2)(1)(2)(1)(2)(1)(1)(4)(1)(1)(5)(2)(2)(2)(2)(9)(13)jQuery ReferenceError: $ is not defined 错误的处理办法
字体:[ ] 类型:转载 时间:
今天开始要学习jQuery,写第一个Hello Word时,居然jQuery ReferenceError: $ is not defined
一看很明显是没有引用脚本库,但是脚本库确认引用了。
后面,把&script type="text/javascript" src="/statics/js/jquery-1.4.2.min.js"&&/script&中的/statics/js/jquery-1.4.2.min.js改为statics/js/jquery-1.4.2.min.js,居然就可以了。
我在IIS里也启用了绝对路径,但是怎么就是不行呢?想不明白。
另外把jquery-1.4.2.min.js也是可以正常运行的。
想不明白,为什么会这样,好在问题解决了,也就算了,如果有遇到这样情况的朋友,可以告知一下。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具Chrome调试JS报错“Uncaught ReferenceError: xl_chrome_menu is not defined”的解决办法 - 博客频道 - CSDN.NET
Coding Everyday
分类:web前端
使用Chrome浏览器的开发人员工具的Console面板查看JS错误日志时,总是提示如下信息:“Uncaught ReferenceError:
xl_chrome_menu is not defined”。是因为在Chrome浏览器中安装了迅雷下载支持插件的原因,卸载或停用之后就不会有这个错误提示了。
排名:千里之外
(12)(9)(4)(2)(7)(14)(3)jQuery中location('')函数在Chrome中显示Uncaught ReferenceError: load is not defined错误
[问题点数:40分]
jQuery中location('')函数在Chrome中显示Uncaught ReferenceError: load is not defined错误
[问题点数:40分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2014年5月 Web 开发大版内专家分月排行榜第二2014年4月 Web 开发大版内专家分月排行榜第二
2014年3月 Web 开发大版内专家分月排行榜第三2014年2月 Web 开发大版内专家分月排行榜第三2013年7月 .NET技术大版内专家分月排行榜第三2013年6月 .NET技术大版内专家分月排行榜第三2012年9月 .NET技术大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。

我要回帖

更多关于 wangxian 的文章

 

随机推荐