I'm making a simple loading bar and it seems that Facelets does not like my conditional statements in my JavaScript.
Here is my code:
<div class="loader_bar">
<div></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
setTimeout(function() {
var current_width = parseFloat($('.loader_bar div').css('width'));
var max_width = parseFloat($('.loader_bar').css('width'));
var next_width = current_width / max_width * 100 + 1;
if (next_width <= 100) {
$('.loader_bar div').css('width', next_width + '%');
setTimeout(arguments.callee, 10);
}
}, 100);
});
</script>
When I load the page I get the following error:
javax.servlet.ServletException: Error Parsing /device/main/site/test.xhtml: Error
Traced[line: 69] The content of elements must consist of well-formed character data
or markup.
Which corresponds to the operator in the if statement
of my JS function "<=" in
if(next_width <= 100).
Why does this not work?