You are here: irt.org | FAQ | JavaScript | Link | Q1686 [ previous next ]
Try the following which allows pages to be defined in JavaScript, and then loaded when a button is pressed:
<html> <head> <script language="JavaScript"><!-- function page1() { return '<html><body>Hello world (1)</body></html>'; } function page2() { return '<html><body>Hello world (2)</body></html>'; } function nextpage(page) { if (!document.image) { location.replace('javascript:page' + page + '()'); } else { location.href = 'javascript:page' + page + '()'; } } //--></script> </head> <body> <form> <input type="button" value="Next page 1" onClick="nextpage(1)"> <input type="button" value="Next page 2" onClick="nextpage(2)"> </form> </body> </html>