If your function is inside the document.ready then you will be able to call global functions as well in ajax success. if your ajax call is in global. then you will not be able to call a function inside document.ready. because of scope limitations..
samples: Ajax inside document.ready
function testb() {
alert('ddd');
}
$(function () {
$('[id$=btnsubmit]').on('click', function () {
$.ajax({
type: "GET",
dataType: "json",
url: "/Content/test",
success: function (data) {
// alert(data);
testa();
testb();
}
});
});
function testa() {
alert('zxfgsfg');
}
});
it will work..
IF Still you want to call that function in that way, please check below solution:
function tesss() {
alert('ddd');
}
var M7 = {};
$('[id$=btnsubmit]').on('click', function () {
$.ajax({
type: "GET",
dataType: "json",
url: "/Content/test",
success: function (data) {
// alert(data);
M7();
tesss();
}
});
});
$(function () {
M7 = function () {
alert('zxfgsfg');
};
});