javascript - 小白求助:网站后台开发框架问题?
小弟想问下,现在主流的网站后台管理大体的框架都怎么做?
1.后台导航栏和顶部信息栏不动,点击导航,主要显示区域用ajax动态请求信息加载?
2.还是为后台的每个导航按钮做一个HTML链接页面,然后公用的导航栏和顶部信息栏include进来?
3.如果采用2为后台的每个导航按钮都做一个HTML连接,每次请求的话都要加载哪些CSS/JS文件,是不是浪费带宽不太好,造成网站打开缓慢?
有更好的思路请大神赐教,小白现在很迷茫。。
回复内容:
小弟想问下,现在主流的网站后台管理大体的框架都怎么做?
1.后台导航栏和顶部信息栏不动,点击导航,主要显示区域用ajax动态请求信息加载?
2.还是为后台的每个导航按钮做一个HTML链接页面,然后公用的导航栏和顶部信息栏include进来?
3.如果采用2为后台的每个导航按钮都做一个HTML连接,每次请求的话都要加载哪些CSS/JS文件,是不是浪费带宽不太好,造成网站打开缓慢?
有更好的思路请大神赐教,小白现在很迷茫。。
可以选择一款成熟的前端框架来写,公共的部分(headerBar, sideBar, footer)写成可复用的组件就方便很多了,和后端的交互用ajax传输json。后台管理系统的话用angular.js
好像方便些,处理表单,表格什么的,通过angular的指令能方便很多。1.x版本可以通过directive
自定义指令,内部自带精简版的jQuery(好像叫jQLite),$ajax,如果是RESTful server-side
,可以使用$resource
,路由上ui-router
比较好用,不讲究样式的话,angular-ui-bootstrap
提供了大部分写好的指令直接使用。
angularjs 全覆盖
分两种 一种是ajax或者类似freemark的included。一种是单页面方式,也就是点击每个菜单都是一个新页面
大部分采用后者
影响页面加载速度的是数据,图片等内容,这都可以解决,看淘宝什么的。人家优化的就是牛
现在都是用框架 的router,通过页面hash刷新页面,你说的导航和顶部作为layout,layout里的内容就是每个页面hash的内容,每个ajax请求写在相应页面部分,layout只会刷新一遍,你找一个框架实践一下就知道了
我也有过类似的困惑,后来研究过几个后台管理系统,大体就是你所说的那两种,一种异步ajax加载页面信息的技术;一种网页全刷新的,这种也包含使用iframe模式的和纯粹网址刷新的。我比较常使用iframe模式,异步模式在展示逻辑复杂的数据时对js要求较高。全网页刷新模式可以使用上面仁兄说的公共组件、layout布局等技术简化开发。至于速度,静态文件多做些优化影响不大。
Hash技术模式也不错,我比较感兴趣不过还没深入研究。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.
