I'm trying to load the html inside the body of an external file and it's not finding the body section for some reason.
The code to retrieve it looks like this:
$.get(href, function(data)
{
tabdiv.html($(data).find('body').html());
});
It ends up putting "" in tabdiv.
if I watch data I get:
| "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/crm.css" type="text/css" media="screen" /> <script type='text/javascript' src='lib/jquery/jquery-1.4.2.min.js'></script> </head> <body> <h1>Contacts</h1> </body> </html> " |
If I watch $(data) I get
It's like somehow it's not correctly parsing the data.
The html I am reading is as follows:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/crm.css" type="text/css" media="screen" />
<script type='text/javascript' src='lib/jquery/jquery-1.4.2.min.js'></script>
</head>
<body>
<h1>Contacts</h1>
</body>
</html>