Well, the problem looks to be within RemoveHTML(), which is a custom
function from your off-the-shelf software, so you want to start there.
Unless you can show that the following code snippet fails, the problem will
be either your server's configuration or the custom software:
<%=String(rs("Question")).length > 100?
String(rs("Section")).substr(0, 100) + "...":
String(rs("Section"))%>
Now, I have to note a few weird things you've said:
1. the RemoveHTML() function you showed is written in VBSCRIPT. But the
failure is in JSCRIPT. Totally different languages, so not certain how you
got into that state
2. RegExp.Global requires a certain version of VBScript -- maybe you have an
older copy registered on this machine.
--
//David
IIS
http://blogs.msdn.com/David.Wang This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Dan Roberts @ Kent State" <Dan Roberts @ Kent
[quoted text, click to view] State@discussions.microsoft.com> wrote in message
news:220EA18D-902A-495D-8542-5626AC69B5A9@microsoft.com...
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
(same
versions of IIS, .Net, etc..) 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!