how to get data using jquery and populate on web page dynamically how to get data using jquery and populate on web page dynamically json json

how to get data using jquery and populate on web page dynamically


  • First, execute your code after document is ready:

     $(function(){    /* your code */ });

or

     $(document).ready(function(){        /* your code*/     });
  • Secondly, use $.ajax, pass in error call back to check whether there's any exceptions.


+1 adeneo - If you look in the developer console for chrome you'll see you're getting the CORS error. Other than that, your code should work. The JSON returned is fine and your code seems to do the right thing with it, but you're not getting the JSON.

See the answer in this SO XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin for a good explanation of the resolutions.