I am using jquery's "$.post()" function to add a list entry to the mysql database, in php.
$(document).ready(function(){
$(".theSubmit").click(function(){
var content = $("textarea").val();
var listn = $("input[name='list_name']").val();
var groupn = $("input[name='group_name']").val();
$.post("/secret_url/lists/add_to_list",
{list_item: content, list_name: listn, group_name:groupn},
function(html){$("li:last").after(html);});
});
});
All that works fine and the new list item is added to the page. However,using firebug, I observe that I get this extra html header information (see below) as well as my returned data. The info I want and render to the page is inside the "li" below. Everything from the doctype after I'd like to strip or prevent from being included since it becomes visible inside a jeditable edit in place input also on the page.
<li>
<input type="checkbox" name="row" class="checkbox">
<input type ="hidden" name="id" value="60" class="contentId">
<div id="60" class="editable">test Item 4</div>
</li>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html/strict.dtd">
<html>
<head>
<title>Checklists</title>
<link href="http://checklist.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.7.custom.min.js"></script>
<script type="text/javascript" src="jquery.jeditable.js"></scrip >
</head>
<body>
Can I strip the html head content or stop it from being sent back along with the pertinent info?