jquery.load function cannot load jquery in embedded html

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

jquery.load function cannot load jquery in embedded html

Abhik11
My problem is I am unable to get the jquery embedded in a html/php file when I call it from another file.

For example, I have 2 html files, test1 and test2

test1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" src="lib/jquery-1.3.2.min.js"/></script><script language="javascript" type="text/javascript"> $(document).ready(function(){ $('#content').empty().load('test2.html'); }); </script>

</head>

<body>
<div id="content"></div>

</body>
</html>


test2.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script language="javascript" type="text/javascript" src="lib/jquery-1.3.2.min.js"/></script><script language="javascript" type="text/javascript"> $(document).ready(function(){ alert(202); }); </script>

</head>

<body>
test
</body>
</html>


When I run test1.html it just shows "test" and not the alert. So obviously it cannot call the jquery.
Can you please suggest ways so that I can call the jquery from test1.html?

Please help.