Drezard Posted March 18, 2008 Share Posted March 18, 2008 So I have 4 files all up. index.php contains the code that the end-user will see. engine.js contains the code for the AJAX request function. pagea.php and pageb.php contains the code i want it to display. Now, I have written most of the code, I just don't know how to form the basics of the engine.js. WITHOUT all the error correcting and checking if this and that is enabled, what should engine.js look like if when the user clicks the 'pagea' link it displays the php script from pagea.php in it and same except for pageb? Heres what the code looks like: index.php: <html> <head> <script src='engine.js' type='text/javascript'> </script> </head> <body> <div id='main'> </div> <a href="javascript: AjaxRequest('pagea.php')">PageA</a> <a href="javascript: AjaxRequest('pageb.php')">PageB</a> </body> </html> engine.js: function AjaxRequest(page) { } pagea.php <?php echo "This is page a"; ?> pageb.php <?php echo "This is page a"; ?> Could you please help? Thanks, Daniel Quote Link to comment https://forums.phpfreaks.com/topic/96673-basic-code/ Share on other sites More sharing options...
haku Posted March 18, 2008 Share Posted March 18, 2008 http://www.w3schools.com/ajax/default.asp Quote Link to comment https://forums.phpfreaks.com/topic/96673-basic-code/#findComment-495002 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.