I have this:
function OpenVote(id, stemme) {
var postThis = 'infoaboutvote.php?id='+id+'&stemme='+stemme;
}
and this:
<script type="text/javascript">
OpenVote(10, CripO);
</script>
Why have i done wrong? as you see i want 10 to be “id” and CripO to be “stemme”
“CripO” looks like a string to mea — which means it should probably be surrounded by quotes :
Else, it might be a variable — in which case you should ensure it is initialized before executing that portion of code.
Also, in your
OpenVotefunction, you are assigning an URL to thepostThisvariable ; but this will not do anything else.Especially, it will not send any kind of Ajax request : you need more code, if you want to send an Ajax request to that URL, and get a result.