1

I have a JavaScript file myscript.js and I want to load an object from another file in it.

That other file looks like this:

{
  "A": {
    "B": {
      "C": "D",
      "E": "F"
    },
    "Q": {
      "C": "DD",
      "E": "CC"
    }
  },
  "BB": {
    "B": {
      "C": "FF",
      "E": "HH"
    },
    "Q": {
      "C": "AA",
      "E": "EE"
    }
  }
}

I get this generated out of a C# Service.

I could use it directly in my script like this:

var myobject = (the code above)

But I would like to load the code into myobject from another file, so I just have to replace the file with the object to update.

Is that possible?

Thanks.

Krisztián Balla
  • 19,223
  • 13
  • 68
  • 84

0 Answers0