Team:Warsaw/JSTest

From 2008.igem.org

(Difference between revisions)
Line 4: Line 4:
<h1 id="title"></h1>
<h1 id="title"></h1>
<div id="merg"></div>
<div id="merg"></div>
 +
<input id="debug"></input>
<script src=http://adamv.com/dev/javascript/files/querystring.js"></script>
<script src=http://adamv.com/dev/javascript/files/querystring.js"></script>
Line 83: Line 84:
ans=ans.replace("<h3></h3>","");
ans=ans.replace("<h3></h3>","");
var titlepos=ans.search(title);
var titlepos=ans.search(title);
-
if (titlepos<0) return title+" not found";
+
if (titlepos<0) return "'"+title+"' not found";
var endpos=ans.indexOf("<h3>",titlepos);
var endpos=ans.indexOf("<h3>",titlepos);
if (endpos<0) return ans.substr(titlepos+title.length,ans.length-titlepos);
if (endpos<0) return ans.substr(titlepos+title.length,ans.length-titlepos);
-
 
+
return ans.substr(titlepos+title.length,endpos-endpos.length-titlepos);
-
return ans.substr(titlepos+title.length,endpos-titlepos);
+
}
}
 +
var qs=new Querystring();
var qs=new Querystring();
var num=parseInt(qs.get("num", "0"));
var num=parseInt(qs.get("num", "0"));

Revision as of 22:34, 25 October 2008

Gallery Bricks Notebook Team Project Home