blog.exotec

TYPO3 . XHTML/CSS . JavaScript/AJAX . iPhone/iOS

GET Variablen mit Javascript auslesen

  function get_GET_params() {
     var GET = new Array();
     if(location.search.length > 0) {
        var get_param_str = location.search.substring(1, location.search.length);
        var get_params = get_param_str.split("&");
        for(i = 0; i < get_params.length; i++) {
           var key_value = get_params[i].split("=");
           if(key_value.length == 2) {
              var key = key_value[0];
              var value = key_value[1];
              GET[key] = value;
           }
        }
     }
     return(GET);
  }

  function get_GET_param(key) {
     var get_params = get_GET_params();
     if(get_params[key])
        return(get_params[key]);
     else
        return false;
  }

Kommentar schreiben:


90,613 Spam-Kommentare
blockiert von
Akismet