javascript - jquery load function not working in chrome which is working in firefox? -


this question has answer here:

im working jquery load function require fill content of div page page.

first.html

  <!doctype html>  <html>  <head>   <script src="http://code.jquery.com/jquery-1.9.1.js"></script>    <script>  $('#getselect').find('option:selected').text();  </script>  </head> <body> <div id="getdiv">not loaded yet.</div> </body>  </html> 

second.html

 <!doctype html>   <html>   <head>   <script src="http://code.jquery.com/jquery-1.9.1.js"></script>   </head>   <body>    <b>footer navigation:</b>   <div id="getit"></div>    <div id="getitselected"></div>    <script>   $("#getit").load("first.html #getdiv");   </script>   </body>  </html> 

the script works fine in firefox not working in chrom. please me.

try wrapping code in $(document).ready()

$(document).ready(function(){    $("#getit").load("first.html #getdiv"); }); 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -