0 Replies - 609 Views - Last Post: 02 September 2011 - 04:05 AM

#1 kunal.gt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-September 11

How can i attach extra variable in request on every jQuery ajax call.

Posted 02 September 2011 - 04:05 AM

I want to attach some more data before sending on each and every jQuery ajax request. the data is not constant for example say i want to attache checksum which will generated depending on the data basis of data sent in ajax call. for that i use ajaxSend but it doesnt work in all the cases so please tell me the way to do it so that the data gets attached. Any help will be appreciable please help.
The way which doesnt work is here.

jQuery(document).ajaxSend(function(evt, xmlhttpRequest, settings){
			var tmpSum = generateCheckSum(settings.url,settings.data);//my method to generate checksum
			settings.data += (settings.data.length > 0 ? '&' : '') + 'tmpChk=' + tmpSum;
				
			}
});


Is This A Good Question/Topic? 0
  • +

Page 1 of 1