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; ?>
<script type="text/javascript">
$(function() {
requesttoken = '<?php echo $_['requesttoken']; ?>';
OC.EventSource.requesttoken=requesttoken;
$(document).bind('ajaxSend', function(elm, xhr, s){
if(requesttoken) {
xhr.setRequestHeader('requesttoken', requesttoken);
}
});
requesttoken = '<?php echo $_['requesttoken']; ?>';
OC.EventSource.requesttoken=requesttoken;
$(document).bind('ajaxSend', function(elm, xhr, s){
xhr.setRequestHeader('requesttoken', requesttoken);
});
</script>
</head>