www.webdeveloper.com
Results 1 to 6 of 6

Thread: without server side?

  1. #1
    Join Date
    Dec 2008
    Posts
    4

    without server side?

    What I need is some kind of script or something else (whatever it might be) to be able to add or subtract points on one page, from a total on another page.

    Here's what I mean:

    _____________________
    webpage one:

    Click here to add 5 points
    Click here to lose 5 points

    ____________________

    webpage two:

    500 points total
    ___________________

    When the buttons on page one are clicked, the total number on page two will change.

    Here's the real issue: I need to do it without server side support.

    If its not possible, just tell me so I can stop looking for a way.

  2. #2
    Join Date
    Apr 2008
    Location
    UK
    Posts
    76
    Quote Originally Posted by wildmage92 View Post
    What I need is some kind of script or something else (whatever it might be) to be able to add or subtract points on one page, from a total on another page.

    Here's what I mean:

    _____________________
    webpage one:

    Click here to add 5 points
    Click here to lose 5 points

    ____________________

    webpage two:

    500 points total
    ___________________

    When the buttons on page one are clicked, the total number on page two will change.

    Here's the real issue: I need to do it without server side support.

    If its not possible, just tell me so I can stop looking for a way.
    In Page One....

    Code:
    <script>
    var theWindow = window.open("another.html");
    </script>
    Page 2....
    Code:
    <script>
    var score = 500;
    function changeScore(value) {
    score = score + value;
    theText.innerHTML = score;
    }
    
    </script>
    <div id="theText"></div>
    Back to Page 1....
    Code:
    <input type="button" value="+5" onclick="theWindow.window.changeScore(5)"/>
    <input type="button" value="-5" onclick="theWindow.window.changeScore(-5)"/>

  3. #3
    Join Date
    Dec 2008
    Posts
    4
    This doesn't seem to work for me. There is no text actually shown on 'another.html" (which I renamed 'aaapage2.html').

  4. #4
    Join Date
    Oct 2008
    Posts
    349
    Do you want the 2 pages to be displayed simultaneously (i.e. one is a pop-up) or do you want the 2 pages to be independent? (i.e. user can play with the first page until they get tired and go to the 2nd)

  5. #5
    Join Date
    Dec 2008
    Posts
    4
    I would like them to be independant, but its also a possibility that i have them each in iframes on one page. Is it also possible that the total number stays the same for everyone who looks at them, even if someone changes it?

  6. #6
    Join Date
    Oct 2008
    Posts
    349
    You can use cookies, but everyone gets their own number to play with.

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