javascript - Didn't get response on alert formate in ajax -


I'm using it for my site. I want the warning () feedback, either this is a success or error. I have tried to put the code on script.js like this, but there is no success. I like the tired code:

  done: function (e, data) {alert status} ; // ['status'] like data; Data.context.text (data.Status); },   

My php code which gives feedback in this json format. This code works fine on firebug, but not on the screen.

  if (file_exists ($ TargetFolder. '/'. $ _ Files ['upl'] ['name'])) {echo '{"status": "Image already exists "} '; Go out; } If (! In_Are (stroller ($ extension), $ permission)) {echo '{"status": "Extension is not allowed"}'; Go out; } "{" Status ":" success ") '' ('_'} '; go out;}    

script.js

  done: function (e, data) {//console.log(data.status); // ['Status']; console.log (data.result); // "{" status ":" extension is not allowed "}" var results = jQuery. PRJSNSAS (data.resist); console as data. Log (result.status); // "extension is not allowed" if (result.status! = "Success") {//data.context.addClass('error '); // file name color "red" Data is. Context.text (result.status);}},   

upload.php

     

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -