抽时间对照着案例撸了一遍,学到了蛮多东西,也有很多疑问,其中有个疑问仍是没有撸明白
graph.width = graph.width; //所谓的巧妙用法?
好了废话不多说,贴出源码:
JavaScript Loan Calcualtor
Enter Loan Data: | Loan Balance, Cumulative Equity, and Interest Payments | |
---|---|---|
Amount of the loan ($): | ||
Annual interest (%): | ||
Repayment period (years): | ||
Zipcode (to find lenders): | ||
Approximate Payments: | ||
Monthly payment: | $ | |
Total payment: | $ | |
Total interest: | $ | |
Sponsors: | Apply for your loan with one of these fine lenders: |
贴上最终效果图:
扔在起点摸索中,欢迎大佬解答疑惑。