jubalbarca
Programmer
This script;
Is meant to work out the player's money, then put it into these div tags so the player gets a report (I've just put in all the stuff inside the body tags);
But I'm getting an 'object required' error...
Anyone have any ideas how to solve this?
Code:
function chahe() {
s2 = (slaves*2);
t2 = ((trad/2)*(Math.random()*10));
s5 = (sol*5);
parent.m.location.href="cash.html";
var moneystart = parent.m.document.getElementById("moneystart");
moneystart.firstChild.nodeValue = money;
var slaves = parent.m.document.getElementById("slaves");
slaves.firstChild.nodeValue = s2;
var he = parent.m.document.getElementById("trade");
he.firstChild.nodeValue = t2;
var he = parent.m.document.getElementById("troops");
he.firstChild.nodeValue = s5;
var he = parent.m.document.getElementById("tax");
he.firstChild.nodeValue = pop;
// calculations are here;
money = Math.floor (money + etm + s2 + t2 + pop - s5);
var he = parent.bar.document.getElementById("ho");
he.firstChild.nodeValue = money;
// and back to the report
var he = parent.m.document.getElementById("moneyend");
he.firstChild.nodeValue = money;
}
Code:
<h2>Financial Report;</h2>
<strong><font size="+1">Treasury;<br></font></strong><div id="moneystart" name="moneystart">0</div>
<br>
<strong>INCOME<br></strong>
Trade;<br><div id="trade" name="trade">0</div>
Taxes;<br><div id="tax" name="tax">0</div>
Slave Labour;<br><div id="slaves" name="slaves">0</div>
<br>
<strong>EXPENDITURE<br></strong>
Troops;<br><div id="troops" name="troops">0</div>
<br>
<strong><font size="+1">Current Treasury;<br></font></strong><div id="moneyend" name="moneyend">0</div>
<br><br>
<a onclick="parent.bar.brand(10);">continue</a>
But I'm getting an 'object required' error...
Anyone have any ideas how to solve this?