# Does Node-RED support features like window.onload?

**URL:** https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943
**Category:** General
**Created:** [3 December 2020 12:12 UTC](https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943 "2020-12-03T12:12:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![K9714](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/k9714/32/28434_2.png) [@K9714](https://discourse.nodered.org/u/K9714)
#### Post date: [3 December 2020 12:12 UTC](https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943/1 "2020-12-03T12:12:42Z")

</div>

Thank you for reading the question.

I try to import the css and js files by modifying the mst files on the Node-RED.

The css file works normally, but the js file has problems with the order of execution.

In the js file, some HTML of the Node-RED is modified using jQuery.

So I want to know a function about situations where all dashboards are loaded to modify HTML with jQuery. (A function like window.onload, document.onload)

I have confirmed that it can be implemented using js and HTML of that node by creating a node, but I want to know how to modify the mst, not how to install the node.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [3 December 2020 12:57 UTC](https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943/2 "2020-12-03T12:57:57Z")

</div>

Do you mean the `index.mst` file that is part of the `@node-red/editor-client` module?

If you want to customise the editor, the first thing to look at is using the `editorTheme` setting in your settings file which allows you to add custom javascript and css files that will get loaded by the editor.

> **[Configuration : Node-RED](https://nodered.org/docs/user-guide/runtime/configuration#editor-themes)**

However you chose to do it, then any code you add to `index.mst` or the script via `editorTheme`, will get run in the browser - so you'll have full access to all the standard browser apis like window.onload.

As we provide jQuery in the editor, you can also do:

```auto
$(function() {
   // Code is run when the page has finished loading
});

```

---

<div class="post-metadata">

### Author: ![K9714](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/k9714/32/28434_2.png) [@K9714](https://discourse.nodered.org/u/K9714)
#### Post date: [3 December 2020 13:11 UTC](https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943/3 "2020-12-03T13:11:53Z")

</div>

Thank you for kindly answering the gibberish question.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [1 February 2021 13:11 UTC](https://discourse.nodered.org/t/does-node-red-support-features-like-window-onload/36943/4 "2021-02-01T13:11:55Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
