I want to use javascript variables in URL as querystring parameters. what is correct way?
var fromSemester = document.getElementById('<%= newFromSemesterValue.ClientID%>').value;
var toSemester = document.getElementById('<%= newToSemesterValue.ClientID%>').value;
I wan to use fromSemester and toSemester variables in URL as querystring parameters like below: But javascript throws en error. What is the correct way to use VAR variables inside URL?
var url = 'MyPage.aspx?id=2&fromsemester='fromSemester'&tosemester='toSemester'&language=eng'
But this URL is not working
+. If you wish to use backticks, then you need to use${variableName}.