Dividing the script - server side and client scripts in the web page

xiaoxiao2021-03-06  40

Generally introducing information on dynamic web development will mechanically talk about HTML, then speak JS, then cut into the topic to talk about the dynamic web page, and finally give some examples, such as message board, forum, even small e-commerce websites, etc. . The updated ASP.NET may even only sport from Winform, and then talk about WebForm ... This makes the programmer unable to contact the underlying code, and cannot understand the overall architecture and workflow. I think the appearance of ASP.NET is a bit like the birth of the advanced language. The high-level language compiler implements the process of automatic compilation link advanced language code to assembly code. Although the final code is not so simple, but after all, multi-optimization is also acceptable In the range. Nowadays, the ASP.NET is originally wanted to encapsulate all client code to achieve automatic generation process from WebUI CodeBeHide to HTML, but because of variety of reasons, you can't do full to meet developers' needs (can be said, it produces " Compilation code "Don't worry", many basic functions need to understand the client script and make handmade modifications to be implemented. It is this contradictory stage where ASP.NET is now, we have more reason to master more knowledge, from HTML, CSS to JScript, Behavior, XML. In the words, this article will directly put the server-side scripts and client scripts in a comparison, which is very few people who have done, or unwind some entry confused, such as why the server-side script is not popping up a dialog, Pop-up the setting box, open a new window, and so on. Take a look at these two, what kind of jurisdiction and role, then use to meet how to make these two scripts to interact with to achieve stronger features. The picture shows the layered scratch of the early PHP4, although it is not very clear from the current N layer architecture, but still can understand. Two scripts are simple: as the name suggests, a run on the server, a run on the client. And their tasks are also clear: server-side scripts are only used to generate web code (which can include HTML, CSS, JS, etc.), which is the usual ASP / ASP.NET, PHP, JSP, etc. in Dynamics The webpage is generally surrounded by "<%%>", "", etc. The client script is completely interpreted in the customer browser, either in "