sbenjamin

saveValue

Jul 27th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function saveGlobalValToSession(name,val){
  2.     //save state here.
  3.     //stringify if the value passed is an array or an object.
  4.     if (typeof(val) === 'object'){
  5.         val=JSON.stringify(val);
  6.     };
  7.    
  8.     jQuery.ajax({
  9.             url : 'assets/CFC/session.cfc?method=saveState',
  10.             type    : 'POST',
  11.             data    : {
  12.                     name: name,
  13.                     val : val,
  14.                     cfctoken: Globals.get('cfctoken')
  15.                    },
  16.             dataType: 'json'
  17.     }); //ajax
  18. };
Advertisement
Add Comment
Please, Sign In to add comment