Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody, I am programming a game with javascript and using some PHP for login register etc.. I want to link to an external file and execute the code there and then get the result in the javascript file. I did some research and most people say to use ajax. I have zero experience with ajax so it would be great if you could help out.
Here is my code:

XML
<html>
    <head>
        <title>
            test
        </title>
    </head>

    <body>
        <script src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script type="text/javascript">
            var timeAtEnd = 1;
            function submitHS () {
            alert("ha");
                $.ajax({
                    $.alert("buahah");
                    type: "GET",
                    url: "mathMemory/submitHS.php",
                    data: {timeAtEnd = "timeAtEnd"}
                    success: function() {
                        echo "success";
                    };
            });
        }
        window.onload = submitHS();
        </script>
    </body>
</html>



All I really want to do right now is have the connection work which i don't think it is doing.
Thanks in advance for any help!
Posted
Updated 23-Apr-14 7:58am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900