Dictionary object in JavaScript?

Results 1 to 3 of 3

Thread: Dictionary object in JavaScript?

  1. #1
    Eric Trudel Guest

    Default Dictionary object in JavaScript?

    Is there anything similar in JavaScript to the dictionary object of VBScript or Java language?<BR><BR>Thanks for any help<BR><BR>Eric

  2. #2
    Join Date
    Dec 1969

    Default RE: Dictionary object in JavaScript?

    Actually, every object in JavaScript is an associative array, which is very similar to a dictionary. For example, these two fragments are logically identical:<BR><BR>myObj.Item = "A String";<BR>myVar = myObj.Item;<BR><BR>myObj["Item"] = "A String";<BR>myVar = myObj["Item"];<BR><BR>This is what give JavaScript it&#039s psuedo-object-oriented capabilities. <BR><BR>Dunc

  3. #3
    Eric Trudel Guest

    Default Objects in Application variables

    Thanks for the help. It does work perfectly. <BR><BR>But I am having further problems implementing this. The reason I wanted a dictionary-like object is to store it in an Application variable in order to spare me from having 100 application variables. Instead of calling Application("tooltiptext1");, Application("tooltiptext2");, [...] I wanted to call Application("tooltiptexts")("text1");, Application("tooltiptexts")("text2");[...]. But I get an error when I try to store my dictonary-like object in an Application variable <BR><BR>Error Type:<BR>Application object, ASP 0197 (0x80004005)<BR>Cannot add object with apartment model behavior to the application intrinsic object.<BR><BR><BR>Why is that? Is there a work around for this?<BR><BR>[Note]<BR>I know some people don&#039t like application variable for such things but we have a fixed number of tooltips that will be translated in 3 languages. I did not want to hardcode the tooltips and have to change them in 200 pages. Instead we use different databases for each language and store the tooltip texts into an Application variable using global.asa file.<BR><BR>I know could just create 100 Application variables to store the tooltip texts but I prefer to have them in a Dictionary-like object to separate them from the other Application variables. <BR><BR>And why I don&#039t want to use an array? Because if one tooltip is removed from the database it will screw all my numeral references to it. <BR><BR>&#060;B&#062;All help appreciated!&#060;/B&#062;<BR><BR>Eric<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts