Accessing FFXIV Data
Reading Data from FFXIV (Concept)
FFXIV is inserted into a number of hidden <div> tags at the top of the HTML file after the opening <body> tag. The contents of each of these values can be read in using JavaScript. While Chromatics will automatically keep these values updated with the latest data, a page refresh would normally be required to get the latest data; as this is quite inefficient to do, wrapping your JavaScript functions in a setInterval() call is the preferred method to update your plugin data.
Setup your Plugin to Read FFXIV Data
To access the FFXIV data within your plugin, you need to include two JavaScript files into your HTML file. The first is the JQuery library. You can do this by linking directly to the latest dist inline:
Or alternatively, you can download the latest version and store it in your /js folder:
Secondly you must include a JavaScript reference to the ffxivsetup.js file which Chromatics generates. You can do this by adding the following JavaScript include after the above JQuery line:
Both these files must be inserted before the closing </head> tag.
Accessing the Data
Once JQuery and ffxivsetup.js have been loaded in the page, you can add an in-line <script> section just before the closing </body> tag to fetch the data into variables. We recommend using the following technique to do so:
Important: We recommend not setting an interval time of less than 300 milliseconds.
Last updated