Can someone test this example and share the results? http://timothypowell.net/blog/?p=23 When I do:
var myVar = \'<% request.getContextPath(); %>\'
var myVar = '<%=request.getContextPath() %>'; alert(myVar);
You forgot to out put = before request and remove ; after getContextPath()