Parag A
Parag A

Reputation: 453

Append a javascript variable to url

I am calling a url from javascript. I want to append my javascript variable as a parameter.

I tried following but its not working. The name is the parameter that has issue

var name='myName';

var url = '<%=request.getContextPath()%>/wizards/script/add_script_wizard1.faces?organizationKey=<%=request.getAttribute("organizationKey")%>& name=+name+';

Please help

Upvotes: 0

Views: 1181

Answers (1)

DeweyOx
DeweyOx

Reputation: 719

Get rid of the space between the ampersand and the variable name 'name'

var name='myName';
var url = '<%=request.getContextPath()%>/wizards/script/add_script_wizard1.faces?organizationKey=<%=request.getAttribute("organizationKey")%>&name='+name;

Upvotes: 1

Related Questions