0

When I open live preview in brackets the page comes up but never finishes loading. Live preview has worked fine while working on HTML and CSS files, but now that I'm incorporating Javascript I am having this issue.

I have re-installed the program twice with no success, restarted my computer, tried running live preview while all extensions were disabled, and have searched through numerous pages on google on how to fix this issue with no solution.

Also it seems that adding the "script" tag (sourced to my javascript file) is causing the issue. When I run live preview without the tag it loads fine.

This has been an issue for some time so any guidance would be GREATLY appreciated. Thanks!

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Section 2: JavaScript Language Basics</title>
    </head>

    <body>
        <h1>Section 2: JavaScript Language Basics</h1>
        <script src="script.js"></script>
    </body>
</html>

I've emptied the Javascript file in an attempt to identify the problem. As stated earlier this code alone would have live preview loading non-stop.

Please let me know if anymore information is needed. Thanks again!

hjones49
  • 3
  • 4

1 Answers1

0

I think it has to something with the directory like which folders you placed it in for example if the .js file is at the same place as the index.html then what you've done should work.

if not it's in, for example, a folder called "js" then use something like

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

play around with

../

or

./

because I can't tell without seeing your file structure I can't really know what's happening.

54x1
  • 93
  • 7
  • So my main folder is named "javascript-basics", within that are two more folders named "final" and "starter" both having a html file and a javascript file. – hjones49 Jan 11 '20 at 13:17
  • I've just attempted to pull the starter folder (the one I'm working on) out of the main "javascript-basics" folder and run that in brackets alone and it's still giving me the same issue. – hjones49 Jan 11 '20 at 13:19
  • Ok, so weird update. I've separated the "final" and "starter" folders by taking them out of the "javascript-basics" folder (this folder is now empty) and deleting 1 of them at a time and running the remaining folder. They both work separately with the other deleted but now this issue reads in the console "Failed to load resource: the server responded with a status of 404 (Not Found)". Any idea what could be going on there? – hjones49 Jan 11 '20 at 13:45
  • I solved the issue. Turns out I didn't add an increment to a loop, causing it to loop indefinitely. Thanks for your help! – hjones49 Jan 14 '20 at 00:49