Hi guys, how do I get to run a php page into a javascript?
Outside the framework yii I can make it happen, now within the framework of several shapes and tried with no success!
I tried to create a widget for this too and nothing! someone give me a light?
The following code:
$(document).ready(function(){
$("#montadora").change(function(){
$.ajax({
type: "POST",
url: "busca.php", //-> Here I think the problem is, I can not call this framework within the page at all!
data: {montadora: $("#montadora").val()},
dataType: "json",
success: function(json){
var options = "";
$.each(json, function(key, value){
options += "<option value=" + key + ">" + value + "</option>";
});
$("#veiculo").html(options);
}
});
});
The problem is with the url. If you place busca.php in the root folder of your project, it will work. But it is not recommended to proceed this way. Check the link below: