AJAX doesn't get loaded
AJAX doesn't get loaded
AJAX response doesn't get loaded on the page:
janisrough.dyndns.biz/todo15.html
This page was working. I can't find what I did.
The AJAX data is returned in an array but but the rows don't get appended as unordered lists.
The bug could be in the each function and it doesn't split out the values or it could be somewhere in the form?
I don't get the alert('Load was performed') in firebug header.
Thanks please help. I've been going over this for 2 days.
(document).ready(function() {
$.ajax({
url: 'ajax/get_todosx.php',
dataType : 'json',
success: function(data) {
var list_start ='<li "class" = "todo-list" >';
var list_end ='</li>';
var checkbx ='<input type="checkbox" id="task" checked="false" />';
var delRow ='<input type="button" value="Delete" class="btnDelete" onclick="deleteRow(this)" />';
$('.result').html(data);
alert('Load was performed.');
var rows= '';
$.each(data, function(idx,item) {
rows+= list_start + checkbx + item.todo + ', ' + item.name +','+ item.date + delRow +list_end;
});
$("ul").append(rows);
}
});//end document ready
It could also be in the form but it was working.
<div id="todos">
<header>
<h1>Taskos</h1>
<h2>— a tasklist todo app —</h2>
<form id="taskForm" onclick="return submitForm()">
<input name="task_todo" value="What needs to be done?" /><br />
<input name="todo_name" value="By whom?" />
<input name="due_date" value="By when?" /><br />
<button type="submit" class="fg-button ui-state-default" >Submit</button>
</form>
</header>
<section class="main">
<form id="task-list">
<input id="toggle-all" type="checkbox" />
<label for="toggle-all">Mark all as complete</label>
<ul id="todo-list">
</ul>
</form>
</section>
<footer>
<a id="clear-completed">Clear completed</a>
<div id="todo-count"></div>
</footer>
</div>
I also tried returning the data as a valid JSON encoded object in case that was it but it still doesn't display.
janisrough.dyndns.biz/todo16.html