Don't wait for document ready for setting requesttoken

This commit is contained in:
Bart Visscher 2012-08-30 23:10:24 +02:00
parent 8380e6f658
commit 6324daecc0
1 changed files with 4 additions and 8 deletions

View File

@ -31,14 +31,10 @@
?> ?>
<?php endforeach; ?> <?php endforeach; ?>
<script type="text/javascript"> <script type="text/javascript">
$(function() { requesttoken = '<?php echo $_['requesttoken']; ?>';
requesttoken = '<?php echo $_['requesttoken']; ?>'; OC.EventSource.requesttoken=requesttoken;
OC.EventSource.requesttoken=requesttoken; $(document).bind('ajaxSend', function(elm, xhr, s){
$(document).bind('ajaxSend', function(elm, xhr, s){ xhr.setRequestHeader('requesttoken', requesttoken);
if(requesttoken) {
xhr.setRequestHeader('requesttoken', requesttoken);
}
});
}); });
</script> </script>
</head> </head>