I have some trouble to hide some div in my application, this code is used in jQuery UI tabs.
In the controller :
public ActionResult MyAction()
{
return View("MyView", model);
}
In the view "MyView", I have this :
<script type="text/javascript">
$(document).ready(function () {
$('#divToHide1').hide();
$('#divToHide2').hide();
});
</script>
<div id="divToHide1">
</div>
<div id="divToHide2">
</div>
The problem the div are never hidded, any idea ?
Thanks,
Update1 : when I switch to second tab, I do the prcedure below. The switch to thez tab is ok, I receive an "alert1", and I receive "1" correspondinf to the length, but the div is still visible.
function e2() {
var jqxhr = $.post("/Controller/MyAction", function (data) {
$('#tabs-2').html(data);
})
.success(function () {
alert('alert1');
})
.error(function () { })
.complete(function () {
alert($('#divToHide1').length);
$('#divToHide1').hide();
});
}
Update2 : I tried with class instead of id ... and look ok
document.ready, yeah?