When judging client files, you can copy the code varfso, sfilespec; filespec & quot; C: pathmyfiletxt & quot; fsonewActiveXObject (& quot; ScriptingFileSystemObject & quot ;); if (fsoFileExists (filespec) s + & quo when judging client files, you can use the copy code var fso, s = filespec; // filespec = "C: /path/myfile.txt "fso = new ActiveXObject (" Scripting. fileSystemObject "); if (fso. fileExists (filespec) s + = "the file exists. "; elses + =" the file does not exist. "; alert (s); When copying code to determine a server (network file), you can use the copy code var xmlhttp = new ActiveXObject (" Microsoft. XMLHTTP "); xmlhttp. open ("GET", yourFileURL, false); xmlhttp. send (); if (xmlhttp. readyState = 4) {if (xmlhttp. status = 200) s + = "yes. "; // The url contains else if (xmlhttp. status = 404) s + = "does not exist. "; // The url does not exist else s + =" "; // other statuses} alert (s );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.