javascript - jquery load function not working in chrome which is working in firefox? -
this question has answer here:
- jquery .load() not working in chrome 3 answers
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
Post a Comment