I have the following code to bring up a jqplot graph in the head:
<script type="text/javascript">
$(document).ready( function() {
alert("javascript working!");
$.jqplot('statgraph', [[[1, 1], [2, 2], [3, 3]]]);
});
</script>
And the following imports in the head (yes, the imports are before the ready() function):
<script language="javascript" type="text/javascript" src="WEB-INF/lib/jquery/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="WEB-INF/lib/jquery/jquery.jqplot.min.js"></script>
<link rel="stylesheet" type="text/css" href="WEB-INF/lib/jquery/jquery.jqplot.css" />
I am running these from a jsp with google app engine, but it doesn’t seem to call the ready() function correctly. When I paste this code into a fresh html page, it works. Is the issue with the jsp then? Thanks!
This will work locally, because you can access WEB-INF on your own computer, but not deployed, because you cannot access WEB-INF remotely. Put the js files somewhere else in your war folder. The war folder will be mapped to /, so if you have war/javascript.js, just refer to it as /javascript.js .