Why don't JavaScript and PHP integrate together?

Source: Internet
Author: User
JavaScript can manipulate certain elements of HTML, such as Css,dom, while PHP can also write functions, and PHP's additional function is to connect to the database better. Then there is a question, why not integrate Javascipt and PHP into a new language, you can connect to the database and the page elements can be manipulated. You have to do this work in two languages. or develop JavaScript to connect to the database. Is it not that many languages have increased the complexity of web programming?
Not to do web programming, the question may not be very professional.

Reply content:

You have a very good question.


Nodejs is what you want, learn it.

Changing the world depends on you JavaScript can also be connected to the database, and the DOM can be manipulated.
The old version is IE's ActiveX, can call window built-in database component number library, but because to reduce the security settings of IE, use very little.
The latest has node-webkit, the node and WebKit integrated into the development of desktop use, the interface is the Web page, backstage use node you want to even database database, read files on the read file.

But these are the development of small use of convenience, one but to make network use, general or back and forth to separate development, rather than mixed together to write, facilitate the division of assistance, thereby improving the development speed. Simply because of historical reasons, history cannot be changed.
If there is a chance of re-setting the Internet for various technologies, the browser and the backend are unified with PHP, which is the best. JavaScript has many flaws and is not prescriptive enough. This will not be said. The main thing to note is that even if the grammar is "unified", they are still different.

The running interpreter is not together, and the operand and the corresponding library are not the same. Even the syntax of JS is the same as learning two times. It is much less time to learn grammar in any language than in the library.

And now the trend should be the diversification of language, so that different languages do different things, to play their strengths. Hope that the last universal language to solve all problems, white is lazy. What you need is node. js. That's a lot to consider.
For example, you use JavaScript to manipulate databases, and some important data can be easily decrypted even with high encryption.
JavaScript is a browser-interpreted language, and all the code is visible in the browser China
If the code that operates the core data can be accessed by anyone, then that's a really scary thing.
If it's just manipulating some simple data, it doesn't matter if the data is read or leaked. The new feature of HTML5 is that it supports browser local database storage
Another thing is that JavaScript is able to send HTTP requests directly to the database you need to play. NET, it is absolutely suitable for you to see more software engineering ideas to understand. Nodejs can fulfill your wish!
  • 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.