Icon Image Not Getting Picked In Javascript Code
Solution 1:
If the image is not loading the absolute best thing you can do is figure out the path that's actually being requested. There are two things that will absolutely blow you away in doing that.
1.) Apache Access Logs.
2.) Tail for Win32. This program is a REAL TIME LOG MONITOR. I highly recommend using the text color options (Settings [menu] --> Keywords) to highlight HTTP 404 errors in example and WRITE based MySQL queries (DELETE, INSERT and UPDATE). Note that the keywords apply AFTER you've applied them and then something triggers it (the program won't go back to highlight previous lines already executed). Also on occasion I've noticed a slight delay of upwards to just under ten seconds for the log to update though usually it updates once every one to three seconds.
This is of course presuming you're running a copy of Windows, it's based off of a UNIX -f command or something (see their homepage) so it's exceptionally likely you can find a non-Windows application that does this if you're not using a Windows based OS.
When you find the 404 error in the access log (apache/logs/access.log path by the way) compare the FULL path of the 404 REQUEST to the full path of the ACTUAL path and then you'll have a big fat clue as to what you need to fix (e.g. one too many ../).
I also highly recommend using the XHTML base element and setting it to the base index of your site and then setting a var path = ''; to match it. Use a server-side language (e.g. PHP) to determine the correct path and you can EASILY get the EXACT same copy of your site running FLAWLESSLY on BOTH localhost and example.com (live domain) using the exact same copy of your software.
All of this is how I run and maintain my personal site (linked in my profile). I'll try to clarify anything you need.
Solution 2:
You are applying the iconFile
variable as a background image, which takes a url. But you are specifying file paths. You can easily convert these to urls by changing your references from "../images/icons/..." to "/images/icons/..." (for example: iconFile = '/images/icons/search.PNG';
).
Post a Comment for "Icon Image Not Getting Picked In Javascript Code"