Bootstrap FreeKB - JavaScript - Redirect using jquery load
JavaScript - Redirect using jquery load

Updated:   |  JavaScript articles

Let's say you want to redirect a user to a remote URL. This can be done using Javascript.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div id="content-area"></div>

<script>
  $(document).ready(function(){
    $("#content-area").load("http://www.example.com");
  });
</script>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter b96edb in the box below so that we can be sure you are a human.