Team:Warsaw/JSTest
From 2008.igem.org
(Difference between revisions)
Line 99: | Line 99: | ||
function trimContents(ans, title) | function trimContents(ans, title) | ||
{ | { | ||
- | |||
- | |||
h3=new RegExp(/<(h3).*>(.*)<\/\1>/i); | h3=new RegExp(/<(h3).*>(.*)<\/\1>/i); | ||
- | + | ||
- | var | + | var titles=ans.match(h3); |
- | for (var i=0;i< | + | |
+ | for (var i=0;i<titles.length;i++) | ||
{ | { | ||
- | + | if (removeHTMLTags(trimStr(titles[i]))==removeHTMLTags(trimStr(title))) return titles[i+1]; | |
- | for (var | + | } |
+ | |||
+ | var topics=ans.split(h3); | ||
+ | for (var i=0;i<topics.length;i++) | ||
+ | { | ||
+ | if (removeHTMLTags(trimStr(topics[i]))==removeHTMLTags(trimStr(title))) return topics[i+1]; | ||
} | } | ||
Revision as of 00:45, 26 October 2008
|