kwilliams
10-20-2003, 04:52 PM
Can anyone see what I'm doing wrong with the following ASP?:
<%
// **Index minute using keyword
var min = (rsMinutesC.Fields.Item("Minute").Value);//minute
var key = String(Request("txtKeywords"));//keywords
var newmin = min.indexOf(key);//index keyword
var shortmin = (min.substr(newmin, 200));//display minute around keyword
// **Replace keyword with bold and red keyword and display minute with new keyword style
var bold = (shortmin.Replace(key,"<font color="#FF0000"><b>" + key + "</b></font>"));//stylize keyword <<--LINE 292
Response.Write(bold);
%>
...I get this error message on this page, and it references the "var bold" section (marked above):
Microsoft JScript runtime error '800a01b6'
Object doesn't support this property or method
/Local_Govt/minutes_resultsC.asp, line 292
This is basically what I'm trying to accomplish:
1) Display text around keyword entered by user on previous form page. (The text from the DB is called "Minute", and the keyword field from the previous form page is called "txtKeywords".)
2) Stylize the keyword displayed (bold & #FF0000-red font)
For some reason, the first part works on some of the middle records, but not all of them. And the second part where it tries to stylize the "key" variable doesn't work at all. I'm not sure what I'm doing wrong. Any and all help is appreciated. Thanks.
<%
// **Index minute using keyword
var min = (rsMinutesC.Fields.Item("Minute").Value);//minute
var key = String(Request("txtKeywords"));//keywords
var newmin = min.indexOf(key);//index keyword
var shortmin = (min.substr(newmin, 200));//display minute around keyword
// **Replace keyword with bold and red keyword and display minute with new keyword style
var bold = (shortmin.Replace(key,"<font color="#FF0000"><b>" + key + "</b></font>"));//stylize keyword <<--LINE 292
Response.Write(bold);
%>
...I get this error message on this page, and it references the "var bold" section (marked above):
Microsoft JScript runtime error '800a01b6'
Object doesn't support this property or method
/Local_Govt/minutes_resultsC.asp, line 292
This is basically what I'm trying to accomplish:
1) Display text around keyword entered by user on previous form page. (The text from the DB is called "Minute", and the keyword field from the previous form page is called "txtKeywords".)
2) Stylize the keyword displayed (bold & #FF0000-red font)
For some reason, the first part works on some of the middle records, but not all of them. And the second part where it tries to stylize the "key" variable doesn't work at all. I'm not sure what I'm doing wrong. Any and all help is appreciated. Thanks.