javascript - Pass an array from one function to another in jQuery -


I have a page with two functions, the function compiles an array and displays a button when done. The user clicks the button and the array in function B is passed ... I have the function A:

  function createUploader () {var fileArray = new Array (); Var i = 0; Var current = 0; Var jList = $ ("#list"); Var Uploader = New qq.FileUploader ({element: document.getElementById ('uploadDiv'), listElement: document.getElementById ('Separator'), Action: './includes/ajaxUpload/upload.php', Size Limit: 10485760 (current == 0) {$ (on '#'); Submit: function: (id, filename) {current ++;}, interrupted: function (id, filename, feedback json) {fileArray [i] = Filename; I ++; $ ('# fancybox-content') width (290); $ ('# fancybox-wrap'). Width (310) (CCS ("display", ""); $ $ Fancybox.resize ()); $. Fancybox.center $ ('.qq-upload-button') width (290);}}}); }   

Is this also possible? What will be the best way to accomplish this? Announce the array outside the

function, and it can be accessed by both of them.

  var myarray = []; Function Fu (Val) {Mayre Pat (Val); } Function Bar () {Alert (mera); }   

and reading:

Comments