string query and self.location

Discussion in 'JavaScript' started by progfrog, Jan 11, 2009.

  1. #1
    Hi!
    this is a script that refers to the object and property self.location:
    
    <SCRIPT language=JavaScript>
    function reload(form){
    var val=form.cat.options[form.cat.options.selectedIndex].value; 
    [COLOR="RoyalBlue"]self.location='dd.php?cat=' + val ;[/COLOR]
    }
    </script>
    
    ]
    Code (markup):
    Can anyone explain me the last blue command? what does self.location means ? and what is the meaning of this syntax: cat=' + val ?

    as u can see i didn't wrote the script but i have to understand the syntax..


    Thanx
     
    progfrog, Jan 11, 2009 IP
  2. FitchIndy

    FitchIndy Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the line in blue is what actually performs the browser redirect

    the browser will redirect to a file in the current folder named dd.php and passing variable cat along the url with the value of the variable named val.
     
    FitchIndy, Jan 11, 2009 IP