I have some old code I am trying to get to work. The debugger stops where it can't load the user template on the error line below with asterisks. I'm guessing the problem is in the promise. Can I just take out some lines on the promise to force it to work for a demo to make it more straightforward? I don't have any data just a default user in the model. Don't need it to be in a promise. One thing I haven't figured out is this line "if(debug && window.console) " I don't know if debug is on or off. I don't know where that is reference.
The AJAX is returning the data. I can see the JSON in firebug but it does not get presented on the page. I assume the bug is somewhere in the data getting parsed. The submit form button works and a row gets inserted but when the user comes to the page all the todo items should be displayed first. Here is the link:
janisrough.dyndns.biz/todo17.html
How do I trouble shoot? The success alert doesn't fire.
Thnanks,
$(document).ready(function() {
$.ajax({
url: 'ajax/form_handler_copy.php',
dataType : 'json',
success: function(data) {
alert(success);
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)" />';
1. is the onload the page doesn't load the AJAX JSON response data. The data returns but doesn't get displayed so the error is JQuery somewhere.
2. When you click in the form fields you get the error "ReferenceError SubmitForm is not defined". This may be why the page doesn't load. So I'm guessing the problem is with the form inputs (red) or with the submitForm function.
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.
But it doesn't get appended to the web page. The error suggests in the response the data type should be XML or JSON? The response text should only be HTML so I changed the data type in the AJAX to "text". That did not help get rid of the error message so I can get the response appended.
Here is the error message in firebug:
todo13.html (line 114)
XML filter is applied to non-XML value (function () {return this.domManip(arguments, !0, function (a) {this.nodeType === 1 && this.appendChild(a);});})
Here is the code for the submit function: function submitForm() {
Maybe you can see the error from the code but If you would like to see the page: http://janisrough.dyndns.biz/todo13.html . I also tried ("ul").append.html(response) and that was wrong also. Can't I just get a text response without XML or JSON?
The logic is to have the submit button post only one line via AJAX to the unordered list. I also have a load script to load all the rows already posted to the database but I want the submit button to only add the one row first. thanks in advance,
I don't understand if this is a PHP or a JQuery issue for sure but I think I just need help with the .each function to get the right output. I need all the sub arrays and all 3 values.
I'd like each row of the AJAX response to be printed like: checkbox + my to do item + user name + date + delete button checkbox + my to do item #2 + user name + date + delete button checkbox + my todo item #3 + user name + datae + delete button
Instead it is only printing the 3 values of the first row like: checkbox + my to do item + delete button checkbox + user name + delete button checkbox + date + button
So I don't want these values on separate lines and I want all rows.
PHP is returning the database result array in JSON encoded brackets but notice in the .each I have to use response[0] or it returns [object Object] . JSON_encode wraps result in brackets and the [0] index removes the brackets. So I do get the entire array response but can't quite seem to access it right with the .each. Should work all right but that explains why the response is like that.
The syntax error is on the .each() line. This script worked with the AJAX response for only one returned row. I added the .each function to get all the rows from the database and I have a missing parenthesis ")" somewhere. It looks like I broke the success: parameter. If I could fix that then I could test. The POSTed value from the response is todo. It is a todo list. Thanks, if you need to see the page it is janisrough.dyndns.biz/todo11.html The result comes back in the page as undefined but the json response array comes back in firebug. The syntax error I'm getting in NetBeans ide. Thanks again,