A strange "function is undefined" problem occurs when Javascript is called.

Source: Internet
Author: User

Today, I want to save the three scripts on a user registration page that I debugged yesterday into a file, create a folder, put them in it, and then call it. This makes the page look much cleaner, it is also convenient to debug and modify later, so you do not need to pull the scroll bar up and down.

After all the changes, refresh the registration page and find that all scripts do not work! All indicate errors such as undefined function! This is an inexplicable error. The script has been debugged. I know that this person often makes some careless low-level errors, so check the file name and path. That's right! The results of online queries are caused by lower-level errors (such as Chinese equals signs). None of them is similar to me.

Click root smoke meditation, check everything and read everything. The only thing that you don't pay attention to is the new folder. For ease of management, I gave it the name "scripts ...... I copied the three JS files to the root directory for calling. Everything is OK! It's okay to copy it to another folder! Create a new "scripts" folder under this folder and copy it to call it. This is also normal! Create a new folder under the root directory, name it "script", and copy it to call it. It is also normal! The script in the "scripts" folder is called again, and it is invalid again ......

At this point, it turns out that the "scripts" folder under the root directory is a problem. It seems that the scripts folder under the root directory cannot be used, but why can it be said everywhere on the Internet? Is it because I set the default IIS website directly as the result of this website currently being done? I know that there is a scripts folder under the default website at the beginning. What is the conflict? Generally, there are multiple websites on one computer, all of which are virtual directories. I only use this website and direct the default website directory to it to save trouble.

In any case, this problem is solved. If someone is the same as me, go back and change the folder name.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.