I’m trying to get my system set-up to learn jquery and I can’t even seem to get a simple hello world program to work and I’m not sure why. It seems like it should work fine.
I’m using CI so here is my controller followed by my view. Thanks.
class Java extends Controller{
function index(){
$this->load->view('java_view');
}
}
The view file:
<script type = "javascript" src="http://localhost/ci/JS/jquery.js"></script>
<script type="javascript">
$(document).ready(function() {
$("#hi").click(function() {
alert("Hello world!");
});
});
</script>
<a id = "hi" href="">Link</a>
Works perfectly, as proven in this example: http://jsfiddle.net/Tt5s7/
The error has to be in your Linkage to JQuery.js or in that Java Controller.