#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    48
    Rep Power
    14

    check if needed files exist before running scripts


    I turned on my computer and started XAMPP and loaded my local website and all I got was a spinning Ajax loader image on the page
    as expected. Except the image didn't disappear and the content loaded from the database shown. This went on for about 20 minutes
    before I finally rebooted the computer. Then I started placing break points in my code and still couldn't find the problem. After
    many hours not having much success finding the problem, I checked to see if all of the linking files (.css, JavaScript, fonts,
    etc...) actually existed on the server and the paths to those files were correct. It turned out one of the JavaScript files
    didn't exist. Once that file was replaced the website worked.

    Is it possible to check and see if all the necessary files are on the server and have an alert popup if any files are missing before
    any scripts are executed?
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,436
    Rep Power
    9645
    If you're asking about how to solve this in a development environment, all you have to do is look at the browser's error console and it will tell you when files it tried to request weren't found. For Javascript and CSS and such, having important files like those being missing should be such a rare occurrence that IMO coming up with an alert for the circumstance isn't really worth the time.

IMN logo majestic logo threadwatch logo seochat tools logo