Javascript Include Won't Load


Badge +5

I have a form copied from another list that I'm trying to modify.  The previous developer uses the Javascript include file.  I modified the javascript but it wasn't executing so I stripped out all of the javascript except for the following:

NWF$(document).ready(function(){

    console.log('Start custom Javascript');

});

By all that I have read, this should execute once the form has rendered.  When I look at the console, nothing is there.  There aren't any errors.  When I open the form in Chrome DevTools and look at the sources, the javascript file isn't listed as being loaded.

I have checked the following:

The file is named pimform.dave.js and it is present in the siteassets folder in my on-prem SharePoint 2013 site.  I have full admin permissions on the site.  The file is present and can be downloaded by putting the URL in the browser address bar.

On the form settings, I have the following listed under Advanced | Custom Javascript Includes

http://spdev/sales/siteassets/pimform.dave.js

which is the correct URL.

I tested the code, by placing the javascript directly in the form using the Custom Javascript box.

What am I doing wrong? Searching this community site doesn't provide any hints. It seems like it should be easier than this.

Thanks in advance.


2 replies

Userlevel 5
Badge +14

check that you do not have some orphaned spaces at the beginning of JS include line.

are you running the form on the same spdev host?

Badge +5

I may have identified the problem.  The previous person who worked on this enabled check-in/check-out and approval required on that library.  I was accessing it from the file system so I wasn't aware that those were set.  I have changed my process now so after my code changes, I go onto the SharePoint site and check in the file and then approve it.  It's a hassle, but that is how the site is set up.

So far, this has worked.

Reply