/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@CuppyTeaDec 06.2008 — 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.[/QUOTE]


In Page One....

[CODE]
<script>
var theWindow = window.open("another.html");
</script>
[/CODE]


Page 2....
[CODE]
<script>
var score = 500;
function changeScore(value) {
score = score + value;
theText.innerHTML = score;
}

</script>
<div id="theText"></div>
[/CODE]


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)"/>
[/CODE]
Copy linkTweet thisAlerts:
@wildmage92authorDec 06.2008 — This doesn't seem to work for me. There is no text actually shown on 'another.html" (which I renamed 'aaapage2.html').
Copy linkTweet thisAlerts:
@voidvectorDec 06.2008 — 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)
Copy linkTweet thisAlerts:
@wildmage92authorDec 06.2008 — 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?
Copy linkTweet thisAlerts:
@voidvectorDec 06.2008 — You can use cookies, but everyone gets their own number to play with.
×

Success!

Help @wildmage92 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...