Advertisement
RobGcf

Untitled

Sep 17th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. function callBRE(data) {
  2.  
  3. var url = 'apps/mots/cfcs/remote.cfc?method=getBREfuncRemote';
  4.  
  5. $.ajax({type:'POST', url:url, data:data, dataType:'json', cache:false, async:false, success:function(result){
  6. if ( result.SUCCESS == true ) {
  7. $.dump(result);
  8. } else {
  9. alert("Error receiving data.");
  10. $.dump(result.error);
  11. };
  12.  
  13. }});
  14.  
  15. };
  16.  
  17. In the .cfm:
  18.  
  19. $('#ceForm').submit(function(e) {
  20.  
  21. var obj = {};
  22.  
  23. obj = getFormData();
  24.  
  25. callBRE(obj);
  26.  
  27. e.preventDefault();
  28.  
  29. });
  30.  
  31. The facade call:
  32.  
  33. <cffunction name="getBREfuncRemote" output="false" access="remote" returntype="struct" returnformat="json">
  34. (bunch of arguments removed, as well as the creation of an xml document (doc) that is passed in)
  35.  
  36. ret.data = application.brefunction.BREfunc(doc);
  37.  
  38. return ret;
  39.  
  40. Now is it not possible to return the XML as a key of a struct via JSON? Or am I doing it all f'd up? :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement