Another hapless noob... Okay, so I've looked everywhere to try and find out how to make this jQuery/JavaScript function, I hope it's just a mistake in my syntax, but here's my code:
<script type="text/javascript">
$(function()
{
function loadNext(choice) {
$("#thequestion").load("question.php", { ans: choice, id: "<?php echo $row['id']; ?>", nextId: "<?php echo $nextQuestionId; ?>" } );
$("#graph").load("graph.php", { id:"<?php echo $row['id']; ?>", nextId: "<?php echo $nextQuestionId; ?>" } );
alert("loadNext activated");
}
});
</script>
I then call the loadNext(choice) function using an onclick event like so:
onclick="loadNext(YorN);".
Following this I get a 'loadNext is not defined' error.
Amongst the answers that I would accept are: "Y U NO LEARN!" and "You are silly."
Thanks.