什么是新框架? [英] What are the new frames?

查看:145
本文介绍了什么是新框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



几年前,我学会了用框架创建简单的网站。



然而,w3school.com不鼓励这种解决方案,未来的HTML版本也不再支持这些框架。

那么简单的替换是什么?


  • PHP似乎也提供了一个解决方案?如果我不使用PHP(实际上我需要在一个项目中使用JavaEE),那么我怎样才能创建类似框架的网站?




短:如何创建一个漂亮的(框架式)网站?

a href =https://developer.mozilla.org/en-US/docs/Web/CSS =nofollow noreferrer> CSS 。有许多技巧用于放置内容(取决于您想要的确切效果,圣杯是一种常见的愿望)。



The尽管设计师认为有一个菜单始终占用屏幕空间,但是 overflow 属性可以处理页面的子部分。一个好主意通常是错误的。



避免重复元内容



(即将基本结构,导航菜单等),而不需要复制/粘贴它们。



模板系统(或者包含系统)或者运行服务器端(大多数通用)或在构建时(它可以支持只允许静态文件的HTTP服务器)。



这种语言实施起来是无关紧要的,PHP和垃圾一样普遍, Java是一种选择,我倾向于Perl(更具体地说:模板工具包),还有很多其他的东西。对于这类工作,JavaScript变得越来越流行,使用诸如汇编之类的工具变得可用。您可以使用静态网站生成器完成所有操作。



使用搜索引擎找到常用的模板语言或包含适合您选择的编程语言的系统。



在不离开页面的情况下加载新内容



JavaScript,通常与 XMLHttpRequest 对象(该技术称为Ajax)以及(如果您正在进行严重的内容更改)与历史API (所以书签和链接仍然有效)。 Github的这是一个很好的例子。有各种框架,例如 React Angular ,它试图让事情变得更简单。请注意有限的浏览器支持以及所有可能导致JS进行归档的其他内容,使得使用良好的设计原则至关重要。使这些功能健壮的一种方法是编写同构JS


It seems like I'm a bit outdated on website creation.

Some years ago I learned to create simple websites with frames.

Yet this solution is discouraged by w3school.com and frames are no longer supported in future HTML versions.

So what are the simple replacements?

  • iFrames also seem to be discouraged by most developers
  • PHP seems to provide a solution? what is a simple way in php to replace frames?
  • if I'm not using php (actually I need to use JavaEE in one project), how can I create frame-like websites?

Short: How to create a good-looking (frame-like) website nowadays?

解决方案

Generally speaking:

Visually

CSS. There are numerous techniques for laying content out (depending on the precise effect you want, Holy Grail is a common desire).

The overflow properties handle scrolling sub-sections of pages, although designers who think that having a menu using up screen space all the time is a good idea are usually wrong.

Avoiding duplication of metacontent

(i.e. putting things like basic structure, navigation menus, etc on every page without copy/pasting them)

A template system (or an include system) that either runs server side (most common) or at build time (which can support HTTP servers which only allow static files).

The language this is implemented in is irrelevant, PHP is as common as muck, Java is an option, I tend towards Perl (and more specifically: Template Toolkit), there are many others. JavaScript is becoming increasingly popular for this type of job, with tools such as assemble becoming available. You can go all the way with a static site generator.

Use a search engine to find popular template languages or include systems for your programming language of choice.

Loading new content without leaving the page

JavaScript, usually with the XMLHttpRequest object (the technique being known as Ajax), and (if you are doing serious content changes) used in combination with the History API (so bookmarking and linking still works). Github are a good example of this. There are various frameworks such as React and Angular which try to make things easier. Note limited browser support and all the other things that can cause JS to file makes using good design principles essential. One approach to making these things robust is to write Isomorphic JS.

这篇关于什么是新框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆