We are required to set cookies with AJAX requests or in such a way that any AJAX request sends those cookies to the server. One thing to note here is that every AJAX request made to any remote server automatically sends all our cookies to that very server without us having to do anything.
Not possible. It's the browser's responsibility.
Ajax is not inherently secure or insecure. It does however open up 'opportunities' for insecure code.
I need to update a lot of data within a given interval with JavaScript. The problem is, no matter of what JS library i use (even bare-bone js), that all browsers seem to allocate memory on every AJAX request and are not able to free it afterwards. Here is a sample snipped that should reproduce the error:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Memleak Test</title>
<meta charset="utf-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
function readData() {
$.getJSON('data.php');
}
$(document).ready(function() {
setInterval(readData, 1000);
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>
An equivalent test page is available at jsbin
Here is more info on this:
It seems so simple that I think I'm doing something really wrong here, it would be great if some of the JS gurus in here can help me out!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With