Within my project, I have implemented ajax to retrieve html content for the cenDiv div.
This is how my ajax code looks:
$.ajax({
dataType: 'html',
type: "POST",
url: "oat.php",
data: {
standby: standby
},
success: function(data) {
$("#cenDiv").html(data);
$.parser.parse($('#corWSId').parent());
}
});
Here is a snippet of my oat.php code:
if(isset($_POST['inAppInit']))
{
echo '
........
<div style="display:none" id="attFId">...</div>
<div style="display:block" id="attNId">...</div>
........
';
}
Now, I am attempting to change the display properties of both elements. This is my javascript function:
function storFirDoc() {
var docTV = $('#docTitle').val();
if (docTV == "") {
alert("not none");
exit;
} else {
alert('test'); //works Ok
//loadjscssfile('jsui/easyui-1.5.3/jquery.min.js', "js");
//loadjscssfile('jsui/easyui-1.5.3/jquery.easyui.min.js', "js");
$('#attNId').css('display', 'block'); //works fail
$('#attFId').css('display', 'none'); //works fail
}
}
I understand that attNId
and attFId
are not initially present in the DOM since they are returned via ajax. I attempted to reload the necessary js files using the loadjscssfile
function, but encountered further issues.
If anyone could provide assistance with my issue, it would be greatly appreciated.