src/hg/js/ajax.js 1.6
1.6 2010/02/16 01:26:45 larrym
move some code here from hgTracks.js
Index: src/hg/js/ajax.js
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/js/ajax.js,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -B -U 4 -r1.5 -r1.6
--- src/hg/js/ajax.js 13 Aug 2009 06:47:10 -0000 1.5
+++ src/hg/js/ajax.js 16 Feb 2010 01:26:45 -0000 1.6
@@ -79,4 +79,22 @@
setTimeout("submitMain()",50); // Delay in submit helps ensure that cart var has gotten there first.
return false;
}
+
+function catchErrorOrDispatch(obj, status)
+{
+// generic ajax success handler (handles fact that success is not always success).
+ if(status == 'success')
+ this.trueSuccess(obj, status);
+ else
+ {
+ showWarning("ajax error: " + status);
+ jQuery('body').css('cursor', '');
+ }
+}
+
+function showWarning(str)
+{
+ $("#warningText").text(str);
+ $("#warning").show();
+}