Coder Social home page Coder Social logo

JSON Object in Object about jquery.i18n HOT 3 OPEN

fellipejsousa avatar fellipejsousa commented on May 17, 2024 1
JSON Object in Object

from jquery.i18n.

Comments (3)

 avatar commented on May 17, 2024

Same issue !

from jquery.i18n.

SossenSystems avatar SossenSystems commented on May 17, 2024

Me to... How can i call an object in object, like content.title

from jquery.i18n.

Hrithik248 avatar Hrithik248 commented on May 17, 2024

The error message "Uncaught TypeError: message.indexOf is not a function" is thrown when you try to use the indexOf() method on a variable that is not a string. It seems like you are trying to use this method on an object. The Friends library does support objects inside objects. You can access the nested object by using dot notation or bracket notation. Here's an example of how you can access the nested object:

var json = {
    "en": {
        "appname-title": "Example Application",
        "appname-sub-title": "An example application with jquery.i18n",
        "appname-header-introduction": "Introduction",
         "example": {
                "appname-title": "Example Application",
               "appname-sub-title": "An example application with jquery.i18n"
        },
        "appname-about": "About this application",
        "appname-footer": "Footer text"
        },
    "ml": {
        "appname-title": "അപ്ലിക്കേഷന്‍ ഉദാഹരണം",
        "appname-sub-title": "jquery.i18n ഉപയോഗിച്ചുള്ള അപ്ലിക്കേഷന്‍ ഉദാഹരണം",
        "appname-header-introduction": "ആമുഖം",
         "example": {
                "appname-title": "Example Application",
               "appname-sub-title": "An example application with jquery.i18n"
        },
        "appname-about": "ഈ അപ്ലിക്കേഷനെപ്പറ്റി",
        "appname-footer": "അടിക്കുറിപ്പു്"
    }
};

console.log(json.en.example["appname-title"]); // Output: Example Application
console.log(json.ml["appname-footer"]); // Output: അടിക്കുറിപ്പു്

from jquery.i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.