Javascript parsing html output
Posted: Mon Jun 23, 2008 5:08 am
I've got the following code:
Which keeps telling me that title.replace is not a function. When (just to test) I change title.replace to content.replace it executes perfectly, although obviously producing the wrong output. Why is it doing this?
Code: Select all
title=content.match("<title>.+</title>");
title=title.replace("<title>","");
title=title.replace("</title>","");