Posted By

nicolaspar on 05/30/07


Tagged

get url String querystring query parser leer


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


Javascript - Get QS


 / Published in: JavaScript
 

  1. <script>
  2. function getQueryVariable(variable) {
  3. var query = self.location.search.substring(1);
  4. var vars = query.split("&");
  5. for (var i=0;i<vars.length;i++) {
  6. var pair = vars[i].split("=");
  7. if (pair[0] == variable) {
  8. if( variable == 'swf'){
  9. salida = new String(pair[1]);
  10. salida2 = salida.substr(0,salida.length-4);
  11. }else{
  12. salida2 = pair[1];
  13. }
  14. return salida2;
  15. }
  16. }
  17. }
  18.  
  19. document.write(getQueryVariable('variableGET').toString())
  20. </script>

Report this snippet  

You need to login to post a comment.