Login Form

Login or register to buy licenses or to access software previously purchased.

If you are experiencing login issues, please contact us!
×
Postings

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

Posts only show after being reviewed.

Topic-icon Accessing global variables in different js files

More
3 years 3 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:
var Darray = {};
Darry.array01 = [["text01", "audio01"],
                ....
                ["text10", "audio10"]];
and is accessed by:
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.

Please Log in or Create an account to join the conversation.

More
3 years 3 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.

Please Log in or Create an account to join the conversation.

More
3 years 3 months ago #3434 by mamboze
No problem, thanks

Please Log in or Create an account to join the conversation.