|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Checking to see if files are present...
how could i check to see if a file is present, for example...
try {document.write("<SCRIPT SRC='test.js'><\/SCRIPT>");} catch (e) {it isnt present} i need to know for the following file types... swf wmv wma mp3 gif jpg bmp png i already know js... thanks in advance... colton22
__________________
![]() Hang Out, Listen To Music, Have Fun, and Customize Your Experiance All In One Place! - Colton22's World - This is My World |
|
#2
|
||||
|
||||
|
files present
The snippet you posted won't detect whether or not the js file exists, only if the string was written.
These are your files ? Maybe you could use xmlhttprequest readyState == 4 status == 200 |
|
#3
|
||||
|
||||
|
yea, i just knowticed that it wouldnt work for js files...
what is xmlhttprequest readyState? ill look it up on google also. colton22 |
|
#4
|
||||
|
||||
|
hey i looked up a little more about it...
if i wanted to load a file called songInfo.js how would i tell if it did not load correctly or if it is just the users browser that is slow? could you give me a code snippet of how to do this? colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Checking to see if files are present... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|