Jump to content

Javascript arrays


radalin

Recommended Posts

I have question about javascript and array system. I'm using javascript in my web site and I would like to enable a language selection on it. I'm using language options from php side. an associative array, containing values like $lang["Hello"] => "Hello", and this goes on.

Is there a way to do this with javascript? I mean is there a such an assosiative array option in javascript (which I do not think it's possible.). I have intended to use a getLang function which takes an argument about lang and with switch statements it returns the right value. Well that's ok but it will take a lot of time if I have thousand cases. Any idea is welcome.

Thanks...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.