0

Hi does anyone know of an HTML parser in Javascript? I need it to basically pull all the readable text out of the file for my tag cloud...not metatags only but everything within:

tags:

<meta><p><h1-3><textbox><textarea> 

basically you get the idea.

I saw John Resig's but that changes everything to XML. Before I try and use that and then just parse the XML, which may be easier I don't know, I wanted to see if there was something out there already.

Any help would be appreciate, until then I'll just keep looking around or I might just make it myself .

Sarfraz
384k81 gold badges561 silver badges613 bronze badges
asked May 22, 2012 at 17:26
0

1 Answer 1

1

Using jQuery, you could do something like this:

$(myfileContents).text();

Where myFileContents is a string containing the HTML in your file.

answered May 22, 2012 at 17:27
Sign up to request clarification or add additional context in comments.

2 Comments

Well, jQuery isn't available in PHP (it is, after all, a Javascript library) so yeah, PHP would be a different beast. :)
@Verber: You're going to have to be more specific than that.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.