2

In an application I am working on I build an HTML string of table rows for the purpose of appending to a table in the DOM. I want to save that string as HTML for use later on in a type ahead search function and I want to be able to search the nodes (rows) for name matching. I have the following code to parse the HTML for searching.

var myHtml = $.parseHTML(rowString);

This code generates the following error: "Microsoft JScript runtime error: Object doesn't support property or method 'parseHTML'". Now I have a lot of jQuery working in this page so I don't think it has anything to do with not loading the jQuery libs - googled around a lot and came up with nothing. Any help appreciated. Oh ya - just in case you are going to ask this line of the code that is before the line that causes the error works just fine and adds the rows to the table.

$("#myTable").append(rowString);

1 Answer 1

6

It sounds like you're using an older version of jQuery; parseHTML() was introduced in version 1.8.

Sign up to request clarification or add additional context in comments.

2 Comments

That could be it - we are currently on 1.7.2 - we have been discussing upgrading for a while now but we have to test the entire application with the new version (will probably go to 1.10.2 since we have to support IE 8+ and can not go to 2.0). If that works I will mark this as the answer - will take about a week for full testing.
Is there a way that you know of to accomplish the same thing in 1.7.x ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.