The problem that the absolute path is normal is often invalid when the relative path is used for file loading by require.

Source: Internet
Author: User
The path of the file to be included has already been set to include_path through set_include_path, and then the relative path of the file directly written when the file is loaded using require. Normally, the program can automatically load files in require according to include_path, but now... the path of the file to be included has been set to include_path through set_include_path,

Then use require to load the file, and then directly write the relative path of the file,

Normally, the program can automatically load files in require according to include_path,

But now the problem is that this method is often valid and often fails. That is to say, sometimes loading fails, but refresh and loading is successful.

This problem does not occur if you directly use the absolute path of the file in require.

Reply content:

The path of the file to be included has been set to include_path through set_include_path,

Then use require to load the file, and then directly write the relative path of the file,

Normally, the program can automatically load files in require according to include_path,

But now the problem is that this method is often valid and often fails. That is to say, sometimes loading fails, but refresh and loading is successful.

This problem does not occur if you directly use the absolute path of the file in require.

Is it valid for a while loading files on the same page?

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.