# Is there another solution instead using $.getScript(..) for once add external client javascript in created node html file?

**URL:** <https://discourse.nodered.org/t/is-there-another-solution-instead-using-getscript-for-once-add-external-client-javascript-in-created-node-html-file/73048>\
**Category:** Developing Nodes\
**Created:** [2 January 2023 08:19 UTC](https://discourse.nodered.org/t/is-there-another-solution-instead-using-getscript-for-once-add-external-client-javascript-in-created-node-html-file/73048 "2023-01-02T08:19:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [2 January 2023 12:58 UTC](https://discourse.nodered.org/t/is-there-another-solution-instead-using-getscript-for-once-add-external-client-javascript-in-created-node-html-file/73048/4 "2023-01-02T12:58:52Z")

</div>

If I may chip in here.  
if your custom library is for the Editor, then you maybe over engineering this.

See my post here.

> [@Reading from constants.js file from HTML in custom node](https://discourse.nodered.org/t/reading-from-constants-js-file-from-html-in-custom-node/71247/2):
>
> Hi @ItsDaveTheWave In your nodes root folder node-red-contrib-cool-node, add a folder resources you can then call into this folder like so, in your HTML file \<script src="resources/node-red-contrib-cool-node/constants.js"\>\</script\> [Loading extra resources in the editor : Node-RED (nodered.org)](https://nodered.org/docs/creating-nodes/resources)

Just adding a `resources` folder to your node, will allow Node RED to use any file from this location, and your HTML file can call into this folder, and it will load only once.

just put a normal script file tag at the top of your HTML file and its loaded (and ready to use), whenever your node configuration is used.

the js file here will be loaded as the editor is loaded (not when your configuration is shown)  
i.e it loads once

```auto
<script src="resources/node-red-contrib-cool-node/emoji-picker-new.js"></script>

```

The `resources` folder should be used if your Node HTML requires it's own JS files (or any other resource for that mater, i.e images etc)

You should not need to use `RED.httpAdmin` to fetch your own resources, the ability is baked into Node RED for you.

> **[Loading extra resources in the editor : Node-RED](https://nodered.org/docs/creating-nodes/resources)**

---

_[View the full topic](https://discourse.nodered.org/t/is-there-another-solution-instead-using-getscript-for-once-add-external-client-javascript-in-created-node-html-file/73048)._
