Postings

You can freely browse the forum and post in the community forum.
However, you need a valid license to write posts for support (own a valid commercial software license or have purchased a support membership).

Posts only show once reviewed. This is mainly preventive to keep spam away. Thank you for your understanding!

Accessing global variables in different js files

More
IP: 118.172.96.221 12 years 11 months ago #3432 by mamboze
I've got jquery ui modal dialog working as required in joomla but I've run into another problem. I want to dynamically load the text into the dialog by accessing, in successive dialogs, elements of a js array. This array is globally declared:
Code:
var Darray = {}; Darry.array01 = [["text01", "audio01"], .... ["text10", "audio10"]];
and is accessed by:
Code:
jQuery("span.ws_dialog_icon").on("click",function(evnt) { jQuery("div#ws_dialog").dialog("open"); ..... var tester = Darray.array01[0][0]; jQuery("div#wsd_text").text(tester.toString());
This works when the global array variable is declared in the same file as the jquery code but not if it is placed in a different file. I'm surprised as I thought global declarations applied throughout the jquery namespace.
More
IP: 2.8.51.170 12 years 11 months ago #3433 by admin
Hello,
I don't know if you did already post it there, but you would propbably get an answer in a more general jQuery forum. I do not have an answer for you, I am afraid, as I have not been confronted to this configuration problem before.

Olivier.
More
IP: 118.172.97.209 12 years 11 months ago #3434 by mamboze
No problem, thanks