Team:Warsaw/JSTest

From 2008.igem.org

(Difference between revisions)
Line 5: Line 5:
<div id="progress"></div>
<div id="progress"></div>
<div id="result"></div>
<div id="result"></div>
-
 
+
<script src=http://adamv.com/dev/javascript/files/querystring.js"></script>
<script type="text/javascript">
<script type="text/javascript">
Line 33: Line 33:
}
}
-
function getQuerystring(key, default_)
+
var qs=new Querystring();
-
{
+
-
  if (default_==null) default_="";
+
-
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
+
-
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
+
-
  var qs = regex.exec(window.location.href);
+
-
  if(qs == null)
+
-
    return default_;
+
-
  else
+
-
    return qs[1];
+
-
}
+
-
 
+
-
function gup( name )
+
-
{
+
-
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
+
-
  var regexS = "[\\?&]"+name+"=([^&#]*)";
+
-
  var regex = new RegExp( regexS );
+
-
  var results = regex.exec( window.location.href );
+
-
  if( results == null )
+
-
    return "";
+
-
  else
+
-
    return results[1];
+
-
}
+
-
//document.getElementById("html").innerHTML=
+
document.getElementById("html").innerHTML=qs.get("par", "nothing");
-
alert(gup('par'));
+
/* ]]> */</script>
/* ]]> */</script>

Revision as of 19:53, 25 October 2008

Gallery Bricks Notebook Team Project Home