I am new to the whole javascript / jquery / ajax scene. I have a website that I developed on my personal machine using the following jquery ajax script. It works fine on my machine, but then when I upload it to the server, nothing happens.
$.post( "action URL here", { lat_max: params.lat_max, lat_min: params.lat_min, lng_max: params.lng_max, lng_min: params.lng_min, building_residents: params.building_residents, building_type: params.building_type }, function(json) { buildings = json; updateMarkers(); if(polygons.length > 0){ for(var i = 0; i < poly_buildings.length; i++){ buildPolyBuildings(); } }else{ showAllMarkers(); } filterResults(); }, "json" );
I have been banging my head about this for several hours, and the only idea I left concerns what I do not understand is the request / response headers. When I run this script on my live site, there is nothing in the request / response header in Firebug. However, there are many things when I run it locally. What am I not getting?
There was a request to see the difference in the headings. Here is what I get on my development server:
ResponseHeaders Date Tue, 20 Dec 2011 20:45:07 GMT X-Powered-By PHP/5.3.6 Transfer-Encoding chunked Connection Keep-Alive Server Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 Content-Type text/html Keep-Alive timeout=5, max=100 RequestHeaders Content-Type application/x-www-form-urlencoded Accept application/json, text/javascript, */*; q=0.01 X-Requested-With XMLHttpRequest
And here is what I can get on the server:
ResponseHeaders RequestHeaders Content-Type application/x-www-form-urlencoded Accept application/json, text/javascript, */*; q=0.01
Again - I do not know that this is a problem, but this is the only functional difference that I see between the two environments.