javascript - Jquery .ajax() local testing -
i've got little .ajax function trying load content after document ready.
$(document).ready(function(){ $.ajax({ url: 'php/accounts-blocks.php', cache: false, beforesend: function() { $('#accounts-blocks').html('please wait...'); }, success: function(html) { $('#accounts-blocks').html(html); } }); });
however, when i'm trying test page locally (just on pc), ajax shows "please wait" message forever, , doesn't load content. should install local hosting or in order test ajax functionality, or wrong script?
ajax (xhr) not work in browsers (there exceptions such firefox) when running script locally without having local web server installed. chrome example not allow it.
use browser less strict security, or install local http server.
Comments
Post a Comment