UrlParser.js
function UrlNode(data){
    this.append = function(next){
        this.next = next;
    };
    this.getData = function(){
        return this.data;
    };
    this.setData = function(data){
        this.data = data;
    }
    this.getNext = function(){
        return this.next;
    };
    this.setParams = function(params){
        var queryParameters = params.split("&");
        if(queryParameters != null){
            this.params = [];
            for(var counter = 0; counter < queryParameters.length; counter++) {
                var keyValuePair = queryParameters[counter].split("=");
                this.params[keyValuePair[0]] = keyValuePair[1];
            }
        } else{
            queryParameters = null;
        }
    };
    this.getParams = function(){
        return this.params;
    };

    //set var's for this object
    var queryParamSplit = data.split("?");
    this.params = null;
    this.data = null;
    this.next = null;
    if(queryParamSplit != null && queryParamSplit.length > 1){
        this.setData(queryParamSplit[0]);
        this.setParams(queryParamSplit[1]);
    } else{
        this.setData(data);
    }
}
function UrlNode(data){
    this.append = function(next){
        this.next = next;
    };
    this.getData = function(){
        return this.data;
    };
    this.setData = function(data){
        this.data = data;
    }
    this.getNext = function(){
        return this.next;
    };
    this.setParams = function(params){
        var queryParameters = params.split("&");
        if(queryParameters != null){
            this.params = [];
            for(var counter = 0; counter < queryParameters.length; counter++) {
                var keyValuePair = queryParameters[counter].split("=");
                this.params[keyValuePair[0]] = keyValuePair[1];
            }
        } else{
            queryParameters = null;
        }
    };
    this.getParams = function(){
        return this.params;
    };

    //set var's for this object
    var queryParamSplit = data.split("?");
    this.params = null;
    this.data = null;
    this.next = null;
    if(queryParamSplit != null && queryParamSplit.length > 1){
        this.setData(queryParamSplit[0]);
        this.setParams(queryParamSplit[1]);
    } else{
        this.setData(data);
    }
}
function UrlNode ( data ) { this . append = function ( next ) { this . next = next ; } ; this . getData = function ( ) { return this . data ; } ; this . setData = function ( data ) { this . data = data ; } this . getNext = function ( ) { return this . next ; } ; this . setParams = function ( params ) { var queryParameters = params . split ( "&" ) ; if ( queryParameters != null ) { this . params = [ ] ; for ( var counter = 0 ; counter < queryParameters . length ; counter ++ ) { var keyValuePair = queryParameters [ counter ] . split ( "=" ) ; this . params [ keyValuePair [ 0 ] ] = keyValuePair [ 1 ] ; } } else { queryParameters = null ; } } ; this . getParams = function ( ) { return this . params ; } ; //set var's for this object var queryParamSplit = data . split ( "?" ) ; this . params = null ; this . data = null ; this . next = null ; if ( queryParamSplit != null && queryParamSplit . length > 1 ) { this . setData ( queryParamSplit [ 0 ] ) ; this . setParams ( queryParamSplit [ 1 ] ) ; } else { this . setData ( data ) ; } }
Created by jlidder on 15-07-18.
Created by jlidder on 15 - 07 - 18 .