Reputation: 261
I've a problem when loading the page. I want to do a simple plot using flot charts and I've tried the same code in a separate html file and it works, but when I load it in my code the page does not stop loading. Never. And this causes the:
$(document).ready(function () {
$.plot($("#placeholder"), [d1]);
});
To never perform the plot action, as it never stops loading the content and it is not ready. The code I'm using that never stops loading includes Javascript, and can be seen in the next link: http://pastebin.com/NWdRqPCA . Does anyone have any idea of where my code gets "stuck" and so it won't stop loading and then plotting? Thank you!
Upvotes: 2
Views: 961
Reputation: 261
Solved. The document.write() was causing the error. It's better to use:
<script>
document.getElementById("demo").innerHTML = your_variable_to_display;
</script>
Upvotes: 1