Sunday 15 April 2012

ajax - getting an error while using window.location.assign() -


I want to give a new location but somehow I can not do this while I got an error here My code is

  jQuery.ajax ({type: "POST", data: 'name =' + countryname, url: "master / validationCountry.jsp", // cache: false, Async: false, success: Function {response.getContextPath () + "/ jsp / admin / AdminMaster.jsp? A = 1"); // window.location.reload (); / / Window.location.replace (Request.getContextPath () + "/ jsp / admin / AdminMaster.jsp? A = 1"); Czech = true;}, error: function () {check = false;}});   

I have an error: ReferenceError: request is not defined

plz help me

It looks like you are trying to use an HTTP subnet Prog object using JavaScript Are there.

request.getContextPath () Server Side Object, it is not available on the client side.

A possible solution here is to use a global variable, such as _context = & lt; Context-path-from-request & gt; and use it in your script

This can be done in your view file such as jsp / velocity / freeware / tiles

No comments:

Post a Comment