In PHP projects that use Requirejs, if PHP returns some JavaScript code, where do I put it?

Source: Internet
Author: User
If Requirejs is used in the front end of my PHP project,
So what if some of the PHP code would return some JavaScript code snippets to run, where would you put the returned code?

Always feel scattered to be very messy and difficult to maintain?

Or is that what I do with PHP's return JavaScript code?

My understanding of Requirejs is that a page only need to introduce a JS, by this JS to deal with all the things, do not know so understanding right, seeking guidance.

I Meng new 2333 have not seen any of the things to ask for advice ~

Reply content:

If Requirejs is used in the front end of my PHP project,
So what if some of the PHP code would return some JavaScript code snippets to run, where would you put the returned code?

Always feel scattered to be very messy and difficult to maintain?

Or is that what I do with PHP's return JavaScript code?

My understanding of Requirejs is that a page only need to introduce a JS, by this JS to deal with all the things, do not know so understanding right, seeking guidance.

I Meng new 2333 have not seen any of the things to ask for advice ~

Requirejs is an implementation of the AMD modular specification, as far as my development experience is concerned, the current requirejs is used relatively little and is generally based on the development of NPM ecology, i.e. the COMMONJS specification, or a modular approach based on the ES6 module specification, And the author said that the return JS code fragment is not encountered.

  • 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.