In the linked post is a screenshot of the javascript lines.. but sending score and.. is very easy with the built in ajaxplugin or if you want pass it per post with a custom ajaxpost plugin.. <img src="smileys/smiley2.gif" border="0" align="middle" />
Ty, i can't make this with a label...?
Because my porpuse is... Get the score at the final of the game... :/
c2runtime.js i add this:
function showScore()
{
var myScore = document.getElementById('testScore');
alert("ola");
$.post("score.php", {score: myScore}, function(data) {
alert(data);});
}
testScore is the ID of my text box.
now my php code:
<?
$score = $_POST['score'];
echo $score;
?>
html code:
<html>
<head>
<title>Untitled Document</title>
<script src="c2runtime.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write("<script src='jquery-1.7.1.min.js'>\x3C/script>")</script>
</head>
<body>
<button id="showID" onclick="showScore()">Show Score</button>
</body>
</html>