Javascript file not found

nmizer6275
nmizer6275 Community Member Posts: 6
UPDATE: I got it to work by changing the type to Header Scripting and using the file dropdown instead of pointing to the file with the "edit" button. I'd still be curious if anyone knows why the meta tag method would just stop working.

I have a project with a linked javascript file that I've been working on with no problem, but yesterday I started getting an error, "Failed to load resource: the server responded with a status of 404 (Not Found)" whenever I preview the project in a browser or publish it to html.

I'm including the script using an html extension object, with type "Meta tags." The script in the extension is

<script src="myScript.js"></script>

and myScript.js is in the extern folder of the project.

I have another project with the same setup, and it is working with no problems. Presumably I changed something somewhere that made it stop working, but I'm banging my head against the wall trying to figure out what it might be. I've also tried making a new file and linking that, in case something in myScript.js is bad, but I get the same error for an empty test.js file.

I'm using Lectora 17. Any ideas on what might keep the html from seeing the js file would be greatly appreciated.

Thanks in advance!

Comments

  • klaatu
    klaatu Community Member Posts: 988
    Meta tags are for meta data, period. Use header scripting for Js. If you post your problem child we can take a look see.
  • jasonadal
    jasonadal Community Member Posts: 441 ♪ Opening Act ♪
    Would the path to the file be part of the issue? (Using the KISS method - is it plugged in?). If the file is in a subfolder, my instinct is that the src should point to the subfolder then the file:

    script src="\extern\script.js"

    I know I'm a culprit of missing the simple things (notoriously, semi-colons in JS), so thought I'd put it out there.