php - jQuery AJAX Post not working -


I do not understand why this script does not work. It has something to do within AJAX PostScript / Function. Right now, when I submit my form, it runs php code on the same page. What it should do, send the values ​​of the form for Project_Azax.fp, then there will be a refund of success on the page which is correct or false.

  $ (document) .ready (function () {$ ('div # didIt'). Hide (); $ ('form [name = adminForm]'). Submit (function () ($ {'.post' ('/ project_ajax.php', {action: $ ('[name = action]') Val (), pId: $ ('[name = pId]'). Val (), name ('[Name = name]'. Val (), url: $ ('[url = url]'). Val (), summary: ('[summary = summary]'). Val ()}, Function (data) {if (data.success) {$ ('div # didIt') .Sliddown ('slow');} and {warning ('unsuccessful SA!');}}, 'Jason'); return false ;});});  

What is the code for project_ajax.php below ...

  if ($ _ POST ['action'] == "update") { Prepare field for / / query entry! ----------------------------------- $ pId = $ _POST ['PID']; $ Name = trim (mysql_prep ($ _ POST ['name'])); $ Position = 1; $ Url = Trim (mysql_prep ($ _ POST ['url'])); $ Tb = wrong; // incorrect because I still need to make a script for it $ I = Summary = trim (mysql_prep ($ _ POST ['summary']); $ Builder = $ _SESSION ['userId']; $ Made = date ("YMD"); $ Q = "Update" DB_NAME "Projects" SET name = '{$ name}', condition = '{$ status}', url = '{$ url}', summary = '{$ summary}', creator = ' {$ Creater} ', created =' {$ build} 'WHERE `project` .` id` = {$ pId}"; $ R = mysql_query ($ q, $ connection); if ($ r) {// succeeded $ Data ['success'] = true; $ date ['error'] = wrong; $ date ['message'] = "you are great!";} Else {// failed $ data ['success'] = false ; $ Data ['error'] = true; $ date ['message'] = "you can not fool it!"}} And {$ data ['success'] = wrong; $ date ['error'] = True; $ data ['message'] = "you failed fool!";} Echo json_encode ($ data);  

No : When this page loads the browser is not actually loading loading actually seems to be a blue-ring on the title tab within IE8 like the page is never being loaded.

current This row:

  summary: ('[summary = summary]'). Val ()},  

You have a missing $ function that represents jQuery. OK:

  summary: $ ('[summary = summary]'). Val ()},  

Because you have a JavaScript error, the execution has finished loading this way forever.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -