From bdc1740993c885852213a925fae907001d50b789 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Thu, 26 Apr 2012 12:58:36 +0000 Subject: [PATCH] display friendly message if no data is received from ajax include usage examples: example.html --- example.html | 51 +++++++++++++++++++++++++++++++++++++++++++ jquery.fileManager.js | 4 ++++ 2 files changed, 55 insertions(+) create mode 100644 example.html diff --git a/example.html b/example.html new file mode 100644 index 0000000..a6d39c6 --- /dev/null +++ b/example.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + +

jQuery.fileManager

+ +

Simple

+ +
+ + + + + +

Simple with upload

+
+ + + +

Simple with events

+
+ + + + + \ No newline at end of file diff --git a/jquery.fileManager.js b/jquery.fileManager.js index 9f58bb7..df78910 100644 --- a/jquery.fileManager.js +++ b/jquery.fileManager.js @@ -47,6 +47,10 @@ this.each(function () { // swap with getJSON so not duplicating ajax var $sel = $(this); $.ajax({url:mbOptions.ajaxPath,dataType:'json',type:'POST',data:query,success:function(data, status) { + if (!data) { + $sel.append('No data received. Please ensure ProcessAjax is called in your ajax script.'); + return; + } $sel.data('result',data); $sel.data('options',mbOptions); if (status != "success") {