How to page redirect using jQuery?
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
One does not simply redirect using jQuery
jQuery is not necessary, and window.location.replace(...) will best simulate an HTTP redirect.
For example:
// similar behavior as an HTTP redirect
window.location.replace("http://codingworkspace.com");
// similar behavior as clicking on a link
window.location.href = "http://codingworkspace.com";
Sometimes its works also,
$(window).attr("location","http://codingworkspace.com");
0 comments:
Post a Comment