Comment system with jQuery and problem it!!! |
[eluser]titandj[/eluser]
Hi! You have some inconsistencies in your code... In Jquery: Although it can be omitted, and the ajax function should detect the type of data returned, is good practice to declare the type of data expected in response: Code: $.ajax({ In Controller: do not understand you want to do with this function into the controller, I guess it is a debug of the data received... In Model: You should not perform an insert, without validating the data from the client, either because they may have brought a wrong or no data. I recommend that collect and validate data in the controller If you see your role in codeigniter is working properly, set default data and calls the same as any other page in the browser: CONTROLLER EXAMPLE: Code: function comment_insert() Call the function in your application in a browser: http://mydomain.com/index.php/myControll...ent_insert If all goes well, and performs the insert will see: {"message":"all done!"} Or the specific PHP error or the json error: {"message":"not work!"} In this case, the error is in the data inseción. test and comments! |
Messages In This Thread |
Comment system with jQuery and problem it!!! - by El Forum - 06-27-2011, 11:07 PM
Comment system with jQuery and problem it!!! - by El Forum - 06-28-2011, 04:54 PM
Comment system with jQuery and problem it!!! - by El Forum - 06-30-2011, 01:54 AM
Comment system with jQuery and problem it!!! - by El Forum - 06-30-2011, 08:45 AM
Comment system with jQuery and problem it!!! - by El Forum - 06-30-2011, 08:54 AM
Comment system with jQuery and problem it!!! - by El Forum - 06-30-2011, 09:14 PM
Comment system with jQuery and problem it!!! - by El Forum - 07-02-2011, 12:42 PM
|