The task is to implement the html page loading into a separate div on the page. It seems like for this you can use .load () .. Much has been written in the internet about this. For example, the code:
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $('#but_load').click(function(){ $('#for_load').load('example.html'); }); }); </script> <style type='text/css'> #for_load{ width:500px; height:300px; border:2px solid black; margin-bottom: 10px; } #but_load{ width:500px; height:100px; border:2px solid black; } </style> <head> <body> <div id='for_load'></div> <div id='but_load'></div> </body> </html>
That is, 2 divs are drawn, the first is the block for downloading the html file, the second is the button. Clicking on the first starts the function $ ('# for_load'). Load ('example.html'); Judging by what was written in the internet, the page in the # for_load div should be loaded right at the moment. But nothing happens.
Tell me what could be the error, or what I do not correctly.