Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search


i have an embedded script on my site's homepage that uses JQuery's ready method to execute a function whenever I load my website. The code executes when I load the homepage the first time. But if I navigate to another page on my site and then come back to the homepage, the function won't execute again. How can I fix this?

Here's the code:

<div id="api_text">
    $().ready(function() {
        function(data) {
          const results = JSON.parse(data.body);

          let print_string = "";
          for (var result_key in results) {
            const result_string = results[result_key];
            $("#api_text").append(result_key + " : ");
            $("#api_text").append(result_value + "<br/>");
            print_string += result_string;


Share this post

Link to post

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...