Can't get jQuery ajax work
        Posted  
        
            by 
                yozloy
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by yozloy
        
        
        
        Published on 2012-10-14T03:01:04Z
        Indexed on 
            2012/10/14
            3:37 UTC
        
        
        Read the original article
        Hit count: 157
        
I'm new to jQuery, and it really cool, but I can't get the basic ajax work, there's no error in the console ,so I don't know where goes wrong:
getJSON function version:
   $(document).ready(function(){
        $.getJSON('http://pollview:8888/js/example.json', function(data){
            for(var element in data){
                console.log(data[element]);
            }
        });
    });
then the basic ajax version:
$(document).ready(function(){
    $.ajax({
        url: 'http://pollview:8888/js/example.json'
    }).done(function(data){
        alert('successful');
    });
});
I get me stuck, any idea?
© Stack Overflow or respective owner