Javascript parsing html output

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
SpiderMonkey
Forum Commoner
Posts: 85
Joined: Fri May 05, 2006 4:48 am

Javascript parsing html output

Post by SpiderMonkey »

I've got the following code:

Code: Select all

title=content.match("<title>.+</title>");
title=title.replace("<title>","");
title=title.replace("</title>","");
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?
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Re: Javascript parsing html output

Post by arjan.top »

title is array of matches
SpiderMonkey
Forum Commoner
Posts: 85
Joined: Fri May 05, 2006 4:48 am

Re: Javascript parsing html output

Post by SpiderMonkey »

ah, ok thanks
Post Reply