Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding and subtracting variables fill up cache?

Status
Not open for further replies.

customgt

IS-IT--Management
Joined
Jan 4, 2006
Messages
122
Location
US
I have a javascript with 2 functions.
One function does n = n + 1
The other function does n = n - 1

When I run these one right after each other, I can do it like 10-12 times, then the code does not work anymore.
Im doing this in an Opera browser on an Amino STB.

Ive tried this on my PC in IE7, it doesnt have any problems.

Do you think maybe it has something to with the cache?
 
I just added an alert box to pop up and tell me what "n" is when i run one of the functions. I notice when i do it 10-12 times, that alert box does not pop up either, so its not even trying to run the functions...hmm
 
Hi

And what Opera version ? For example the below works perfectly in my Opera 9.22 on Windows.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title></title>
<script type="text/javascript">
var n=0
function inc()
{
  n=n+1
}
function dec()
{
  n=n-1
}
</script>
</head>
<body>
<form action="#">
<input type="text" name="out">
<input type="button" value="+" onclick="inc();this.form.out.value=n">
<input type="button" value="-" onclick="dec();this.form.out.value=n">
</form>
</body>
</html>

Feherke.
 
Opera Version 0.10.2a
Thats what it said on the box, im guessing it was developed for the Amino application...

The javascript you setup is how mine is basicly...
 
I notice if i used buttons on my page like you did, it does not do this.

If i use the buttons on my remote, and use jmacx to activate the functions then it only lets me do it 10-12 times...hmm I think I can get around this with your help.

If I use a button on my remote, to activate a function that contained:
<input type="button" value="GoDown" onClick=godown()">

Then that function would call the godown() function, and maybe it would work...how would I write that input button as its own function?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top