Multiple html files, One script

Hey, I want to have multiple html files working in one script. Such as an MDT for police or something like that. I thought about using iframe or GitHub - project-error/fivem-react-boilerplate-lua: Basic Lua & React (TypeScript) boilerplate for FiveM or is there another workaround?

Hello mrrrmmmmmm,

Unfortunately, I don’t know of a workaround for this, as the logic is as follows:

FiveM imports the defined nui_page into its internal HTML iframe structure. So you now have an HTML (NUI root) in which all script NUIs are in their own iframe. So your first and last chance is to use iframes, to get one HTML with all data.
Tip: The NUI root including all iframes is also accessible at http://localhost:13172/

Hey Tuncion,
Thank you for your tip. SO HELPFUL <3

Anyways, I found a workaround (not iframe). I face many problems with iframes, so I found a very simple fix for this issue.
Issue: We have index.html, settings.html. And we want to link them together.

HTML (index.html):

<!-- if this element is clicked, execute the openHEY function -->
<a onclick="openHEY()" style="padding: 1px; background-color: blueviolet;">wrghrtghwrthrthwehwrtt</a>

JavaScript (openHEY function):

function openHEY()
{
    // https://cfx-nui-[YOUR-RESOURCE-NAME]/[DIRECTORY-OF-HTML-FILE]
    location.replace("https://cfx-nui-mart/design/settings.html");
}

Hello mrrrmmmmmm,

you’re welcome <3 Nice workaround (solution) so you use the internal DNS (domain) system to map on your resource.