Rate this script:  I Love it  /   I Hate it

QueryString Object


Code


function QueryString(path)
  {
        this.path = path;
        this.toString = function()
        {
                result = this.path + "?";
                for(element in this)
                {
                        if(typeof this[element] != 'function' && element != 'path')
                        {
                                result += element + "=" + this[element] + "&";
                        }
                }
                return result;
        }
       
        this.toLink = function(text)
        {
                return "<a href=\"" + this.toString() + "\">" + text + "</a>";
        }
  }



myObj = new QueryString("http://codebehind.dk");
  myObj.w = 100;
  myObj.rx = 1000;
  myObj.ry = 1000;
  ...
  ...
  document.writeln(myObj.toLink("codebehind.dk"));

 

 

 
QueryString Object scripts | QueryString Object snippet | QueryString Object example | QueryString Object tutorial | QueryString Object code