New answers tagged wp-localize-script
Dynamic variable names are unpleasant to work with. A slightly better solution would be to use a single array / object which references each 'instance' using an auto-incremented integer. This isn't a far cry from what you have already, but it keeps all you parameters inside on variable, and accessing a particular property of an object just feels nicer than ...
JS variables are not directly replaced as you are expecting. Localizing in your code is correct. When you do var jsonPath = itajax.ajaxurl;, value of itajax.ajaxurl is assigned to the variable jsonPath. If you debug this variable in the console, you will get the correct value. console.log(jsonPath);
Top 50 recent answers are included