D
Dan Roberts @ Kent State
I am running some off-the-shelf software that is written in ASP, which uses
JScript to generate dynamic content within HTML forms. There are several ASP
pages which are partially rendering to IE, but stop midway through with an
error embeded in the page: "Microsoft JScript runtime error '800a138f'
'undefined' is null or not an object".
The software package has a large install base with no other customer having
this problem. I also have a second identical install on another server
pointing to the same SQL database, and it doesn't exibit this problem either.
Our own developers were able to work around the problem by making a small
change to the code.
The original code:
<%=String(rs("Question")).length > 100?
RemoveHTML(String(rs("Section"))).substr(0, 100) + "...":
RemoveHTML(String(rs("Section")))%>
Changed to:
<%if (String(rs("Section")).length > 100)
{Response.Write(String(rs("Section")).substr(0, 100) + "...") ;} else {
Response.Write(rs("Section")); }%>
The latter bit of code had to have two changes.. one to change the odd
conditional statement to a more traditional if-statement, and second to avoid
calling the RemoveHTML function, both which cause an error.
function RemoveHTML(Expresion)
on error resume next
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
Expresion = Replace(Expresion, "<br>", chr(10))
RemoveHTML = RegEx.Replace(Expresion, "")
end function
I've searched Microsoft's KB and Googled the error, and so far nothing
useful has come up. Any ideas on what the cause is or how I can further
troubleshoot?
!!! Again, there is nothing wrong with the code.. it works on hundreds of
other servers. There is something particular about my server that is causing
this !!!
Thanks in advance for any help anyone can offer!
JScript to generate dynamic content within HTML forms. There are several ASP
pages which are partially rendering to IE, but stop midway through with an
error embeded in the page: "Microsoft JScript runtime error '800a138f'
'undefined' is null or not an object".
The software package has a large install base with no other customer having
this problem. I also have a second identical install on another server
pointing to the same SQL database, and it doesn't exibit this problem either.
Our own developers were able to work around the problem by making a small
change to the code.
The original code:
<%=String(rs("Question")).length > 100?
RemoveHTML(String(rs("Section"))).substr(0, 100) + "...":
RemoveHTML(String(rs("Section")))%>
Changed to:
<%if (String(rs("Section")).length > 100)
{Response.Write(String(rs("Section")).substr(0, 100) + "...") ;} else {
Response.Write(rs("Section")); }%>
The latter bit of code had to have two changes.. one to change the odd
conditional statement to a more traditional if-statement, and second to avoid
calling the RemoveHTML function, both which cause an error.
function RemoveHTML(Expresion)
on error resume next
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
Expresion = Replace(Expresion, "<br>", chr(10))
RemoveHTML = RegEx.Replace(Expresion, "")
end function
I've searched Microsoft's KB and Googled the error, and so far nothing
useful has come up. Any ideas on what the cause is or how I can further
troubleshoot?
!!! Again, there is nothing wrong with the code.. it works on hundreds of
other servers. There is something particular about my server that is causing
this !!!
Thanks in advance for any help anyone can offer!