If the jsp variables are of primitive type and once the page is loaded the values are not goin to change, then you can forward the variables to the javascript. Example. "& lt;"html> "& lt;"head> "& lt;"script language="javascript"> var jspvariable; function test(tempVariable){ jspVariable = tempVariable; alert(jspVariable); }