tags:

views:

53

answers:

1

Hi,

alert(window.location.href/&name=" + escape(name_var) + "&id=" + escape(id_var));

thanks

+2  A: 

No, it's not correct.

alert(window.location.href + "&name=" + encodeURIComponent(name_var) + "&id=" + encodeURIComponent(id_var));
  1. You have a syntax error in your code, the / that follows window.location.href
  2. Use the concatenation operator, + - myString + "more string"
  3. escape is deprecated, use encodeURI() and encodeURIComponent()
Andy E
`encodeURIComponent`.
bobince
thanks.........
rajesh
@bobince: dammit, I keep confusing them!
Andy E