dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: How do I save and retreive variables with Jquery?

  1. #1
    Join Date
    Feb 2013
    Posts
    19

    How do I save and retreive variables with Jquery?

    Hey guys, thanks for helping me learn to save data from a form to a variable. I am working on my text game for learning purposes and and moving right along. Now it saves the users name and addresses the user by it. But my game is going to need to save and retrieve variables from a file. For now I want to save them locally on my computer. Of course I realize that if its going on the web, which it eventually will for my portfolio, it will need to save and retreive information off the server. Is it similar? Is there a free web hosting service that can do this right now that I can use temporarily? Ideally it would work with a database but I think I need to spend money for that so we wont do that right at this moment. How would one save the variable in a local file and also retrieve it once it is stored. I need to do it the jquery way. I find jquery to be easier to understand. I have a feeling this is going to involve Ajax. Please point me in the right direction. Here's my code so far :

    // mycode
    <html>

    <head>
    <title> Legend of the Dragonstone </title>


    <head>

    <body>
    <header>

    <script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"> </script>

    <script>



    $(document).ready(function() {


    function welcome() {
    $("header").append("<p>Please enter your name.</p>");
    $("#button").click(function(){
    $("p").hide();
    var name = $("#text").val();
    $("header").append("Welcome " + name +".");
    });

    };

    welcome();

    });

    </script>

    </header>

    <body>

    <input type="text" id="text">
    <p></p>
    <input type="button" value="go" id = "button">

    </body>

    </html>

    //mycode

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    you can use a google spreadsheet, or a free hosting plan, many of which provide PHP, which can save to a flat file or DB.

  3. #3
    Join Date
    Feb 2013
    Posts
    19
    Google spreadsheet sounds interesting can somebody tell me how to do it in Jquery.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles