embedded jQuery Code of ajax load page?
I have an html file oldStudent.html That has the following jquery code :
<script>
$(document).ready(function () {
$("div").each(function (index) {
var idDiv = $(this).attr('id');
if (idDiv) {
$("#" + idDiv).load(idDiv + "_v1.html");
}
});
});
</script>
Now in another page Student.html i am loading the oldStudent.html in the following way :
var currentYearFile = function () {
var tmp = null;
$.ajax({
'async': false,
'type': "GET",
'global': false,
'dataType': 'html',
'url': "oldStudent.html",
'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' },
'success': function (data) {
tmp = $(data).find('#wrapper').html()
//alert($(data))
}
});
return tmp;
}();
The issue is the jQuery code in oldStudnet.html is not getting excuted and return temp returns undefined.
Can someone please help regarding this?
Thank you