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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -