Team:Warsaw/JSTest2
From 2008.igem.org
(Difference between revisions)
(13 intermediate revisions not shown) | |||
Line 56: | Line 56: | ||
<br> | <br> | ||
<div align="right"><a href="javascript:toggle_dump()">Toggle source</a></div> | <div align="right"><a href="javascript:toggle_dump()">Toggle source</a></div> | ||
- | <textarea id="dump" readonly="true" class="hidden">core dump</textarea> | + | <textarea id="dump" readonly="true" class="hidden" style="width:100%;height:400px">core dump</textarea> |
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 204: | Line 204: | ||
function get_topics(ans) | function get_topics(ans) | ||
{ | { | ||
+ | ans=ans.replace(/<h3><\/h3>/gi,""); | ||
var ans_topics=new Array(); | var ans_topics=new Array(); | ||
h3=new RegExp(/<h3.*>(.*)<\/h3>/ig); | h3=new RegExp(/<h3.*>(.*)<\/h3>/ig); | ||
Line 212: | Line 213: | ||
{ | { | ||
var notags=titles[i].split(/(<h3>)|(<\/h3>)/i); | var notags=titles[i].split(/(<h3>)|(<\/h3>)/i); | ||
- | + | if (notags[3]==undefined) var currtitle=removeHTMLTags(notags[0]); | |
- | var currtitle=removeHTMLTags(notags[3]); | + | else var currtitle=removeHTMLTags(notags[3]); |
currtitle=trimStr(currtitle.replace(/\+/g,' ')); | currtitle=trimStr(currtitle.replace(/\+/g,' ')); | ||
if(currtitle!="") ans_topics.push(currtitle); | if(currtitle!="") ans_topics.push(currtitle); | ||
Line 225: | Line 226: | ||
for (i in topics) | for (i in topics) | ||
{ | { | ||
- | var | + | |
- | var ans=""; | + | var d=topics[i]; // another dirty IE hack |
- | var num=0; | + | //alert (typeof(d)); |
- | for (var j=0;j<days.length;j++) | + | if (typeof(d)=="string") |
- | { | + | { |
- | if(days[j]!="") ans+="arg"+j+"="+days[j]+String.fromCharCode(38); | + | //if (d.match(/from\ 2008.igem.org/i)==null) continue; |
- | else num=j; | + | var days=d.split(';'); |
- | } | + | var ans=""; |
- | ans=codebase+"num="+num+String.fromCharCode(38)+ans+"name="+escape(removeHTMLTags(i)); | + | var num=0; |
- | document.getElementById("result").innerHTML+='<a href="'+ans+'">'+i+"</a><br>"; | + | for (var j=0;j<days.length;j++) |
- | } | + | { |
+ | if(days[j]!="") ans+="arg"+j+"="+days[j]+String.fromCharCode(38); | ||
+ | else num=j; | ||
+ | } | ||
+ | ans=codebase+"num="+num+String.fromCharCode(38)+ans+"name="+escape(removeHTMLTags(i)); | ||
+ | document.getElementById("result").innerHTML+='<a href="'+ans+'">'+i+"</a><br>\n"; | ||
+ | } | ||
+ | } | ||
} | } | ||
Line 258: | Line 266: | ||
} | } | ||
} | } | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
Latest revision as of 15:57, 27 October 2008
Browse by topics |