问题
you are always such an incredible help to me ... but, Im really stumped here.
http://canboria.co.za/PHP/CALCULATOR/bond.htm
A basic bond/mortgage calculator that I have worked out using some online refs & a little modification.
How can I make this script work out the details on page loading (i did try action onload but, didnt do the trick ... kept running a loop & times out)
Ideally, I want to have that each time a value is altered, it should work out the REPAYMENT VALUE ... any help, ideas or guidence greatly appreciated!
回答1:
The window.onload function seems to work for me.
Working Example
By simply adding this code
window.onload=giveAnAnswer;
来源:https://stackoverflow.com/questions/23683453/how-to-automatically-run-this-code