我试着替换“#34; PROCENT"到"%"在ASP文件中。
但我得到了错误:
Error "800a01b6' Object doesn't support this property or method
<%@ language="javascript"%>
<%
var newSpanPosBeschreibung = Request.QueryString("newSpan");
if(newSpanPosBeschreibung.indexOf("PROCENT") >= 0 ){
newSpanPosBeschreibung = newSpanPosBeschreibung.replace(/PROCENT/g, "%");
}
//then save the [newSpanPosBeschreibung] into Databank.
%>
如何更换&#34; PROCENT&#34;到&#34;%&#34;? THX!
答案 0 :(得分:6)
如果先将变量强制转换为字符串怎么办?
var newSpanPosBeschreibung = String(Request.QueryString("newSpan"));