Return to Snippet

Revision: 3060
at May 30, 2007 12:41 by nicolaspar


Initial Code
<script>
function getQueryVariable(variable) {
  var query = self.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
		if( variable == 'swf'){
			salida = new String(pair[1]);
			salida2 = salida.substr(0,salida.length-4);
		}else{
			salida2 = pair[1];
		}
		return salida2;
    }
  } 
}

document.write(getQueryVariable('variableGET').toString())
</script>

Initial URL

                                

Initial Description

                                

Initial Title
Javascript - Get QS

Initial Tags
url, query

Initial Language
JavaScript