首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

JS报错:对象不支持此属性或方法 '$' 未定义,该怎么处理

2012-03-25 
JS报错:对象不支持此属性或方法 $ 未定义我引用过了JQ了 可是报错JScript codescript srcjquery.js

JS报错:对象不支持此属性或方法 '$' 未定义
我引用过了JQ了 可是报错

JScript code
    <script src="jquery.js" type="text/javascript"></script>    <script language="javascript" type="text/javascript">        function openprompt() {            var temp = {                stateLogin: {                    html: '<div style="font-size:16px; font-weight:600" id="title">注册用户请直接登录</div><span style="font-size:14px; font-weight:100"></span><table id="loginbox" border="0" cellpadding="0" cellspacing="0" style="font-weight:100"><tr style="height:30px;"><td class="bfont">用户名:</td><td align="left"><input class="txtbox" type="text" name="txtUserName" id="txtUserName" maxlength="16" style="width:130px"/><span></span></td></tr><tr style="height:30px"><td class="bfont">密&nbsp;&nbsp;码:</td><td align="left"><input class="txtbox" type="password" name="txtUserPwd" id="txtUserPwd" maxlength="18" style="width:130px"/><span></span></td></tr><tr style="height:30px"><td></td><td align="left"><input id="CheckboxLogin" name="CheckboxLogin" type="checkbox" /><span style="font-size:12px; color:Black">记住我的登陆状态</span>  </td></tr><tr><td></td><td align="left"><input id="loginId" type="button" value="登 陆" style="width:70px; height55px;text-align:center;vertical-align:middle" onclick="javascript:doLogin();"/><span style="margin-left:20px; font-size:12px;font-weight:100"><a href="index.aspx">忘记密码?</a></span></td></tr></table><br />',                    buttons: { 登陆: -1, 注册: 1 },                    focus: 1,                    submit: function(v, m, f) {                        if (v == 0)                            $.prompt.close()                        else if (v == 1)                            $.prompt.goToState('stateRegiest'); //go forward                        else if (v = -1)                            $.prompt.goToState('stateLogin'); //go back                        return false;                    }                },                stateRegiest: {                    html: '<div id="registerTitle" style="font-size:16px; font-weight:600">用户注册</div><span style="font-size:14px; font-weight:100"></span><table id="tableRegiest" border="0" cellpadding="0" cellspacing="0" style="font-weight:100"><tr><td class="bfont" style="font-weight:600">用&nbsp;户&nbsp;名:</td><td align="left"><input class="txtbox" type="text" name="regUserName" id="regUserName" maxlength="16"  style="width:130px;"/><span></span></td></tr><tr><td></td><td align="left"><span>不超过7个汉字,或14个字节(数字和字母)</span><br /><span style="color:#836FFF;font-weight:100">使用真实姓名注册账号可获得<a  href="index.aspx" style="color:#FF0000">实名认证</a></span></td></tr><tr style="height:10px;"></tr><tr><td class="bfont" style="font-weight:600">设置密码:</td><td align="left"><input class="txtbox" type="password" name="regUserPwd" id="regUserPwd" maxlength="18" style="width:100px;"/><span></span></td></tr><tr><td></td><td align="left"><span>密码长度6~14位,字母区分大小写</span></td></tr><tr style="height:40px"><td class="bfont" style="font-weight:600">确认密码:</td><td align="left"><input class="txtbox" type="password" name="regUserPwdt" id="regUserPwdt" maxlength="18" style="width:100px;"/><span></span></td></tr><tr style="height:30px"><td class="bfont" style="font-weight:600">性&nbsp;&nbsp;别:</td><td align="left"><input id="RadioBoy" type="radio" name="regUserSex" style="width:10px" checked="checked" value="1"/>男&nbsp;&nbsp;<input id="RadioGirl" type="radio" name="regUserSex" style="width:10px" value="0"/>女</td></tr><tr><td style="font-weight:600">电子邮件:</td><td align="left"><input type="text" name="regUserEmail" id="regUserEmail" maxlength="50" style="width:150px;"/><span></span></td></tr><tr><td></td><td align="left"><span>请输入有效的邮件地址,当密码遗失时凭此领取</span></td></tr><tr style="height:10px;"></tr><tr><td style="font-weight:600">验证码:</td><td align="left"><input type="text" name="txtRandom" id="txtRandom" maxlength="4" style="width:70px;"/><img id="imgRandomCode" runat="server" title="点击刷新" onclick="javascript:getCode(this);" src="comment/RandomImage.aspx" style="margin-top:0px"/><span id="RandomCodeSP">点击刷新</span></td></tr></table><input id="registerId" type="button" value="注 册" style="width:70px; height55px;text-align:center;vertical-align:middle" onclick="javascript:doRegiest();"/><span>点击"立即注册"表示您同意并遵守<a href="index.aspx">协议</a></span>',                    buttons: { 登陆: -1, 注册: 1 },                    focus: 2,                    submit: function(v, m, f) {                        if (v == 0)                            $.prompt.close()                        else if (v == 1)                            $.prompt.goToState('stateRegiest'); //go forward                        else if (v = -1)                            $.prompt.goToState('stateLogin'); //go back                        return false;                    }                }            }            $.prompt(temp);        }    </script> 


HTML code
  <a href="javascript:openprompt();">注册</a>|<a href="javascript:openprompt();">登陆</a>

JS报错:对象不支持此属性或方法 '$' 未定义

[解决办法]

[解决办法]
你引用的哪个文件?如果是2个文件的话,引用由顺序,该下顺序看看

热点排行