Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
114 views
in Technique[技术] by (71.8m points)

html - What are the new frames?

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...