Reputation: 125
I'm new to JQuery, so I'm a little confused here. I have a button that, onclick, runs this function. When the JQuery is commented out, the alert goes off when the button is clicked. But with the JQuery, nothing is alerted when the button is clicked. What am I doing incorrectly?
<script type="text/javascript">
function LoadList(type){
alert(type);
if(type == "private"){
//$.post("fileone.php", { page: "private" };
}else{
//$.post("fileone.php", { page: "public" } );
}
}
</script>
Upvotes: 0
Views: 122
Reputation: 10195
You have a syntax error. The first line with jQuery needs a closing parenthesis. Check your error console in your browser and it will tell you about this sort of error.
Upvotes: 4
Reputation: 423
There is a syntax error on line 5, you're missing a closing parenthesis.
Upvotes: 8