passing variable via ajax

passing variable via ajax

  1. // Custom Ajax
  2. jQuery.loadScript = function (url, data, callback) {
  3.       jQuery.ajax({
  4.             url: url,
  5.             success: callback,
  6.             data: data,

  7.             async: true
  8.       });
  9. }

  10. // Execute Function 
  11. $.loadScript('js/modules/upload.js', {name:'anoluck'}, function() {
  12. console.log('TEST');
  13. });

  14. // upload.js
  15. $(document).ready(function(){
  16.       how do I get parameter name?
  17. });
How do I get the pass in parameter when loading an external javascript while passing in a variable?
I tried ajax while passing in GET variable but unable to get url query variables
Is there another way of loading external js file on the same server while passing in parameters?