AJAX functionality works without deploying in an HTTP server?
I use AJAX functionality in my project & my coding something similar to the following:
- $('.home').click(function(event){
- event.preventDefault();
- $.ajax({
- url: 'home.html',
- success: function(data){
- jQuery('.contents').html(data);
- }
- });
- })
Initially I (successfully) tested my project after deploying to the Apache server which is running in the localhost.
But, if I just open the page in a browser (without deploying to the server), the project works fine! How this is possible?
According to my understanding, if we send an AJAX request, which is really an HTTP request, which has to be received by an HTTP server and the response should come from the server. Am I missing anything?