passing variable via ajax
- // Custom Ajax
- jQuery.loadScript = function (url, data, callback) {
- jQuery.ajax({
- url: url,
- success: callback,
- data: data,
- async: true
- });
- }
- // Execute Function
- $.loadScript('js/modules/upload.js', {name:'anoluck'}, function() {
- console.log('TEST');
- });
- // upload.js
- $(document).ready(function(){
- how do I get parameter name?
- });
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?