Help onload in <body> to perform ajax apros
$("#kilometers").change(function(){ var searchString = $(this).val(); $.ajax({ url: "index_ajax.php", dataType : "html", data: "q=includes/modules/ajax/LoadCityTax.php&name="+searchString, type: "POST", success: function(msg){$("#city").html(msg);} }); });
I want to output the result of the query to <input id="kilometers">
$("#kilometers").change(function(){/*...*/}).change();
- that's all. Well, and wrap the function in$(function(){/* код */});
=) - ling