Function "is not a function" in javascript
It looks like "save_masmoh_user is not a function" is a very common
problem with JavaScript, yet after looking through quite a few threads I
still cannot understand what is causing it in my case.
I have a custom object, defined as:
function save_masmoh_user(){
var save_masmoh = $("#save_masmoh").serialize();
var ft_user_id = $('#ft_user_id').val();
$.ajax({
url: "<?php echo base_url(); ?>myaccount/saveMasmohToUser/",
type: "POST",
data: {
save_masmoh : save_masmoh,
ft_user_id : ft_user_id
},
dataType: "json",
success: function(data){
if(data.msg == "save"){
alert("Done");
}
else {
alert("Error");
}
}
});
}
No comments:
Post a Comment