Php write web project solution

Source: Internet
Author: User
Tags php write
Php writes a web project to write a web project. Is it better to put JavaScript in a single js file, or to directly write it in an html page? What are the advantages and disadvantages? Php? Js? Web php write web Project
When writing a web project, is it better to put JavaScript in a single js file on the page, or to directly write it in an html page? What are the advantages and disadvantages? Php? Js? Web html php js
------ Solution --------------------
In any case, requirements always come first!
Now that you have used the path in js, you do not want to change it to a relative path.
So is it unnecessary to discuss built-in or external connection?
Of course, you can also embed an independent js file into the main template as a sub-template.
------ Solution --------------------
You can create a js file that stores specific paths. This File defines all path variables. Other js files use the path variables defined in this file. Then the js file that stores the path can be introduced before other js files.
For example, define path. js
It defines var filePath = "****";
The filePath is used as the path in other files.
When used, define in the page:
Script
Script

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.