Jsonp question

Jsonp question

I'm trying to access a json page on a different domain using jsonp. The following block of code doesn't catch any error, but doesn't seem to work either. Has anyone used this before?
function ajaxFunction()
{

   var urljs = "http://www.myserver.net/files/progress/jsonTest.js";
   document.getElementById("debugText").innerHTML = "ajax called";
   
    try {
         $.ajax({
         url:urljs,
           dataType: "jsonp",
         callback: function(){
            document.getElementById("debugText").innerHTML = "great success"
         }
         });


       
    }catch(e){
       document.getElementById("debugText").innerHTML = e;
    }
   


}
    • Topic Participants

    • ben