dr.pepper Posted April 8, 2010 Share Posted April 8, 2010 Ive currently got a html page and a button which when pressed replaces a div within the page with html from another page. Please see below for an example: <html> <header> <script> jQuery.noConflict(); jQuery(document).ready(function() { jQuery("#formID").validationEngine() }); function ajax_request(divId, url) { jQuery('#'+divId).load(url, "", function(responseText, textStatus, XMLHttpRequest) { jQuery('#'+divId).hide() jQuery('#'+divId).fadeIn("slow"); if(textStatus == 'error') { jQuery('#'+divId).html('<p>There was an error making the AJAX request</p>'); } } ); } </script> <body> <input type="button" value="edit" onclick="ajax_request('test', '/test_page.php')"> <div id="test"></div> </body> </header> </html> The test_page.php page was just html and was working fine, however I have added javascript tags for a postcode finder within the page and now it no longer loads. E.g The test_page.php page used to consist of the following and worked fine: <p>This is a test</> Now it consists of the following and doesnt work: <p>This is a test</> <SCRIPT LANGUAGE="JAVASCRIPT" SRC="XXXXX"></SCRIPT> When I click the button to load the new page into the div it now displays a white blank page with just the button from the javascript (Click here to find postcode button) showing in the top left corner. Any idea how to fix this? Quote Link to comment 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.