javascript - Using $(tag).load() successfully in jQuery -
hi i'm trying use jquery load html document existing html document.
i've tried using code below, text doesn't load.
i'm not sure why. point me towards i'm doing wrong please?
<!doctype html public "-//w3c//dtd xhtml 1.0 frameset//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript">$("#test").load("test.txt")</script> </head> <body> <div id="test"></div> </body> </html>
try on dom ready
like
<script type="text/javascript"> $(document).ready(function(){ $("#test").load("test.txt"); }); </script>
and forgotted ending ;
.you can try like
$(function(){ $("#test").load("test.txt"); });
Comments
Post a Comment