![]() ![]() In this article, you will learn the various methods that you can use to send an HTTP POST request to your back-end server in JavaScript. One of the five popular HTTP methods for making requests and interacting with your servers is the POST method, which you can use to send data to a server. ![]() Here we discuss a Brief Overview on jQuery redirect and its Examples along with its Code Implementation.HTTP requests allow your front-end application to interact successfully with a back-end server or database. For jQuery,$(location).attr(‘href’, url) will open a fresh page from the server, whereas, for the javaScript, loads pages from cache.The only difference lies in the manner then a new page is loaded.jQuery uses attr() method for this redirection which is slightly different from that of javaScript.The page or URL redirection using jQuery is a very easy task which can be achieved using just one line of code.In this article, we discussed how to redirect a web page or an URL to another web page using jQuery.The $(location).attr(‘href’, url)requests a fresh page from server, whereas, loads pages from cache. With javaScript, we use with jQuery, we use $(location).attr(‘href’, url). Note: Since we can use both, plain javaScript or jQuery for redirection mechanism, there is a slight difference between the two ways. After 2 seconds, you will be redirected to the new URL page as shown below.The below screen shows the Redirection undergoing with a delay of 2 seconds.We see a button “Click to redirect” which upon click redirects you to the new web page with some delay, in our example, it is 2 seconds.The below screen gets displayed when the above code gets executed.On clicking the above button, new page loads after a short delay. This is an example for jquery redirection after a certain amount of time. We see a button “Go to Google Search”, clicking on which redirects the user from the current page to the new page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |