asp问题,预计'('
在 Internet Explorer 中查看页面时出现此错误 网页错误详细信息
Message: Expected '('
Line: 152
Char: 4
Code: 0
<script>/* <![CDATA[ */qmad.mwidths=new Object();if(qmad.bvis.indexOf("qm_mwidths_a(b.cdiv,o);")==-1)qmad.bvis+="qm_mwidths_a(b.cdiv,o);";;function qm_mwidths_a(sub,item){var z;if((z=window.qmv)&&(z=z.addons)&&(z=z.match_widths)&&!z["on"+qm_index(sub)])return;var ss;if(!item.settingsid){var v=item;while((v=v.parentNode)){if(v.className.indexOf("qmmc")+1){item.settingsid=v.id;break;}}}ss=qmad[item.settingsid];if(!ss)return;if(!ss.mwidths_active)return;if(qm_a(item.parentNode)){var t=0;t+=qm_getcomputedstyle(sub,"padding-left","paddingLeft");t+=qm_getcomputedstyle(sub,"padding-right","paddingRight");t+=qm_getcomputedstyle(sub,"border-left-width","borderLeftWidth");t+=qm_getcomputedstyle(sub,"border-right-width","borderRightWidth");var adj=0;adj=item.getAttribute("matchwidthadjust");if(adj)adj=parseInt(adj);if(!adj||isNaN(adj))adj=0;sub.style.width=(item.offsetWidth-t+adj)+"px";var a=sub.childNodes;for(var i=0;i<a.length;i++){if(a[i].tagName=="A")a[i].style.whiteSpace="normal";}}};function qm_getcomputedstyle(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;}/* ]]> */</script>
148: <%
149: UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
150: If UserIPAddress = "" Then
151: UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
152: end if
153:
154:
155: IF Left(UserIPAddress,11) = "192.168.130" or Left(UserIPAddress,10) = "236.234.11" then
156: %>
157:
158: <%
159: IF ucase(request.querystring("go"))="" then
160: go="HOME"
161: ELSE
162: go = ucase(request.querystring("go"))
163: END IF
164:
165: IF ucase(request.querystring("rdate"))="" then
166: rdate = FormatDateTime(now(), 2)
167: ELSE
168: rdate = ucase(request.querystring("rdate"))
169: END IF
170;
171: If not(IsDate(rdate)) Then
172: rdate = FormatDateTime(now(), 2)
173: End If
174: %>
这是查看源码/运行时
150: <script>
151: <!--
152: if request.querystring("rdate")<>"" then
153: rdate=request.querystring("rdate")
154: else
155: rdate= now()
156: end if
157:
158: function querySt(ji) {
159: hu = window.location.search.substring(1);
160: gy = hu.split("&");
161: for (i=0;i<gy.length;i++) {
162: ft = gy[i].split("=");
163: if (ft[0] == ji) {
164: return ft[1];
165: }
166: }
167: }
168: var rundate = querySt("rdate");
169:
170: if request.querystring("rdate")<>"" then
171: rundate=request.querystring("rdate")
172: else
173: rdate= now()
174: end if
175:
176: document.write(rdate);
177: document.write("<br>");
178: -->
179: </script>
I get this error when viewing the page in Internet explorer
Webpage error details
Message: Expected '('
Line: 152
Char: 4
Code: 0
<script>/* <![CDATA[ */qmad.mwidths=new Object();if(qmad.bvis.indexOf("qm_mwidths_a(b.cdiv,o);")==-1)qmad.bvis+="qm_mwidths_a(b.cdiv,o);";;function qm_mwidths_a(sub,item){var z;if((z=window.qmv)&&(z=z.addons)&&(z=z.match_widths)&&!z["on"+qm_index(sub)])return;var ss;if(!item.settingsid){var v=item;while((v=v.parentNode)){if(v.className.indexOf("qmmc")+1){item.settingsid=v.id;break;}}}ss=qmad[item.settingsid];if(!ss)return;if(!ss.mwidths_active)return;if(qm_a(item.parentNode)){var t=0;t+=qm_getcomputedstyle(sub,"padding-left","paddingLeft");t+=qm_getcomputedstyle(sub,"padding-right","paddingRight");t+=qm_getcomputedstyle(sub,"border-left-width","borderLeftWidth");t+=qm_getcomputedstyle(sub,"border-right-width","borderRightWidth");var adj=0;adj=item.getAttribute("matchwidthadjust");if(adj)adj=parseInt(adj);if(!adj||isNaN(adj))adj=0;sub.style.width=(item.offsetWidth-t+adj)+"px";var a=sub.childNodes;for(var i=0;i<a.length;i++){if(a[i].tagName=="A")a[i].style.whiteSpace="normal";}}};function qm_getcomputedstyle(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;}/* ]]> */</script>
148: <%
149: UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
150: If UserIPAddress = "" Then
151: UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
152: end if
153:
154:
155: IF Left(UserIPAddress,11) = "192.168.130" or Left(UserIPAddress,10) = "236.234.11" then
156: %>
157:
158: <%
159: IF ucase(request.querystring("go"))="" then
160: go="HOME"
161: ELSE
162: go = ucase(request.querystring("go"))
163: END IF
164:
165: IF ucase(request.querystring("rdate"))="" then
166: rdate = FormatDateTime(now(), 2)
167: ELSE
168: rdate = ucase(request.querystring("rdate"))
169: END IF
170;
171: If not(IsDate(rdate)) Then
172: rdate = FormatDateTime(now(), 2)
173: End If
174: %>
This is the view source code/runtime
150: <script>
151: <!--
152: if request.querystring("rdate")<>"" then
153: rdate=request.querystring("rdate")
154: else
155: rdate= now()
156: end if
157:
158: function querySt(ji) {
159: hu = window.location.search.substring(1);
160: gy = hu.split("&");
161: for (i=0;i<gy.length;i++) {
162: ft = gy[i].split("=");
163: if (ft[0] == ji) {
164: return ft[1];
165: }
166: }
167: }
168: var rundate = querySt("rdate");
169:
170: if request.querystring("rdate")<>"" then
171: rundate=request.querystring("rdate")
172: else
173: rdate= now()
174: end if
175:
176: document.write(rdate);
177: document.write("<br>");
178: -->
179: </script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@NEWprogrammer:您似乎将 ASP 与 JavaScript 混合在一起(在第二个代码片段中,Ln. 150 - 179)。该代码中的两个
if request.querystring
块都应位于 ASP 分隔符<% %>
中,这将处理您遇到的特定语法错误得到。看起来好像您根本不需要整个第二个块,因为您似乎不再使用它并且
rundate
GET
参数已经在 ASP 中检查并设置后,您可能可以注释掉或删除整个第二个块。@NEWprogrammer: You seem to be mixing ASP with JavaScript (in second code snippet, Ln. 150 - 179). Both of your
if request.querystring
blocks in that code should be in ASP delimiters,<% %>
, which will take care of that specific syntax error you're getting.It appears as if you don't even need that whole second block at all though since it doesn't look like you ever use it again and the
rundate
GET
parameter is already checked and set in ASP, you could probably just comment out or remove that whole second block.