# I am having difficulty loading my external js file

**URL:** <https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085>\
**Category:** RapidWeaver Classic\
**Created:** [November 20, 2015, 8:29pm UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085 "2015-11-20T20:29:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgg](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hgg/32/1292_2.png) [@hgg](https://forums.realmacsoftware.com/u/hgg)\
**Post date:** [November 20, 2015, 8:29pm UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/1 "2015-11-20T20:29:12Z")

</div>

This is probably very simple but here is my problem. I am using Parse as my application server and have a very complex screen using lots of javascript functions. It seems like I ran out of space in the “Javascript” section of the “Meta Tags & HTML Code” pane of my webpage.

So, I am saving all of that code in a js file but can’t get it to load.

I know it is probably very silly but anyone could point me in the right direction?

Cheers,

---

<div class="post-metadata">

**Author:** ![mastermix](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@mastermix](https://forums.realmacsoftware.com/u/mastermix)\
**Post date:** [November 20, 2015, 9:55pm UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/2 "2015-11-20T21:55:46Z")

</div>

This post was flagged by the community and is temporarily hidden.

---

<div class="post-metadata">

**Author:** ![hgg](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hgg/32/1292_2.png) [@hgg](https://forums.realmacsoftware.com/u/hgg)\
**Post date:** [November 20, 2015, 10:04pm UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/3 "2015-11-20T22:04:02Z")

</div>

If I do a view source, I can see at the end:

…

```
	<link rel='stylesheet' type='text/css' media='all' href='files/stacks_page_page1.css' />
	<script type="text/javascript" src="myStuff.js"></script>
	
</head>
<body>

```

…

In the “Meta Tags & HTML Code/Javascript” I have the following:

document.getElementById(“myDiv”).innerHTML = initMyStuff();

It does not look like “initMyStuff” is found.

---

<div class="post-metadata">

**Author:** ![Turtle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/turtle/32/1438_2.png) [@Turtle](https://forums.realmacsoftware.com/u/Turtle)\
**Post date:** [November 21, 2015, 3:01am UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/4 "2015-11-21T03:01:33Z")

</div>

@hgg is your “myStuff.js” file in the same folder as the page that is referencing it? Path is important and may explain your issue?

Hope it helps  
Brad

---

<div class="post-metadata">

**Author:** ![hgg](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hgg/32/1292_2.png) [@hgg](https://forums.realmacsoftware.com/u/hgg)\
**Post date:** [November 22, 2015, 12:32am UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/5 "2015-11-22T00:32:23Z")

</div>

Hi Brad, where should I put “myStuff.js”? On the same directory where the rw6 file is? I have tried that but does not work.

---

<div class="post-metadata">

**Author:** ![Turtle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/turtle/32/1438_2.png) [@Turtle](https://forums.realmacsoftware.com/u/Turtle)\
**Post date:** [November 22, 2015, 1:15am UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/6 "2015-11-22T01:15:14Z")

</div>

@hgg

> [@hgg](#):
>
> Hi Brad, where should I put “myStuff.js”? On the same directory where the rw6 file is? I have tried that but does not work.

You need to import it into your site resources by dragging it from your finder window into the Resources section of the site on the Right Lower side, and reference it from there in your page 'Meta Tags & HTML Code (under Inspector on right side - the\*\* i\*\* symbol), select header, add (script type=“text/javascript” src=“%resource(myStuff.js)%”) (/script), assuming you just import it into the root of the resources. Alternatively, if this is a site wide use javascript file, you can use Site preferences (Wrench icon), code section, Head sub-section, and use the same HTML I reference above).

If you make a folder under resources for javascripts, say Java, then the path for the resource would be:

src="%resource(Java/myStuff.js)%

This **should** upload your JS file to the resource folder and the page referencing it should be able to find it.

Hope that helps  
Brad

---

<div class="post-metadata">

**Author:** ![hgg](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hgg/32/1292_2.png) [@hgg](https://forums.realmacsoftware.com/u/hgg)\
**Post date:** [November 22, 2015, 7:44am UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/7 "2015-11-22T07:44:34Z")

</div>

Thanks Brad, works beautifully. 🙂

---

<div class="post-metadata">

**Author:** ![Turtle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/turtle/32/1438_2.png) [@Turtle](https://forums.realmacsoftware.com/u/Turtle)\
**Post date:** [November 22, 2015, 12:39pm UTC](https://forums.realmacsoftware.com/t/i-am-having-difficulty-loading-my-external-js-file/4085/8 "2015-11-22T12:39:37Z")

</div>

@hgg, Sweet, glad it’s working for you 🙂
