I have a jqGrid with add/edit feature. To prevent cross site scripting, I use the autoencode feature. I look at the data being passed in the beforeSubmit and afterSubmit methods and I see the encoding working just fine. But when I close the popup by clicking save, the script executes anyways. The afterComplete method shows the script I had typed without any encoding.
The behavior can be replicated in the demo page too http://trirand.com/blog/jqgrid/jqgrid.html (Live data manipulation -> add/edit row)
Please let me know if there is something obvious I missed or if there any other ways I can prevent this scenario