I am trying to have an action that starts when my load()
request is done, but the alert
never shows up. The load()
request works since I can see the content of mypage.html
in my .haha
div. This is the really simple code:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
Hello
<div class="haha"></div>
<script type="text/javascript">
$(document).ready(function(){
$('.haha').load('mypage.html', function(xhr) {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
alert('TEST TEST');
}
alert('TEST TEST');
});
});
</script>
None of the alerts shows up.
EDIT : In my console i have this :
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
FAToolbar.js:1 Uncaught TypeError: $.cookie is not a function