[转] 学习HTML/JavaScript/PHP 三者的关系以及各自的作用
When you write a normal document using a word processor like Microsoft Word/Office, your text is saved in a file with a special format. It is not simply saved as the string of words you typed since the document needs to preserve things like the font you chose, the size of the text, which words are in bold, which italics, and so on. The special format includes not only your words, but all these extra information so that the next time Word opens your document, it can display the document with the exact appearance you created earlier.
你浏览的网页是一个有着某种特定格式的页面,而记录这个页面如何显示就是HTML。
In the same way, web pages are simply strings of words put in a special format that web browsers are able to display. While the format of Word documents is simply called "Word format" (or "doc format"), loosely speaking, one might say that web pages are formatted using "HTML". Take the paragraph of text in the box below for example:
This is an example paragraph to illustrate what HTML is, for the purpose of explaining common terms like HTML, JavaScript and PHP.
If you were to peek into the raw code for the above words, you will see the following:
This is an example paragraph to illustrate what HTML is, for the purpose of <a href="http://www.thesitewizard.com/html-tutorial/what-is-html.shtml">explaining common terms like HTML, JavaScript and PHP</a>.
Notice that it is more or less like the text given earlier, except that there is additional information embedded. For example, the portion that says <a href="http://www.thesitewizard.com/html-tutorial/what-is-html.shtml">
(which I placed in a different font above to make it easier to spot) tells the web browser that what follows, until </a>
is reached, is to be regarded as a link pointing at the web address http://www.thesitewizard.com/html-tutorial/what-is-html.shtml
When the web browser sees this information, it makes the words "explaining common terms like... [etc]" appear as the blue underlined text that represents a clickable link. The rest of the text is just displayed as-is.
2. What are JavaScript and PHP
Since the HTML/CSS combination is analogous to the data found in a Word document, it is good only for displaying information.
If you want your web pages to do different things depending on the situation, you will need a programming language. For example, some websites want to provide a membership facility where people can log into the site, and access certain information. Other sites provide a feedback form so that visitors can contact them. All these things require facilities that a simple document format cannot do.
Programs written in JavaScript run in the web browser itself, so if your website has a JavaScript program, the program will be automatically fetched by your visitor's browser and executed on his/her computer.
的程序, 这段程序就会被返回给用户。然后你的浏览器把这段程序表示出来。
on the computer where your website is located, that is, on
your web host's
computer. After the PHP or Perl program does what it needs to do,
it sends the result to the visitor's web browser, which merely
displays the results.
JavaScript, PHP and Perl are three of the most
commonly-used programming languages on the Internet. They are used
by websites to carry out more complicated operations.
总结一下,PHP是服务端语言,JS是客户端语言。HTML是一种格式。服务端语言主要是用来生成html+javascript这样的客户端页面的,它们不会被实际发送到客户端,而是先在服务器端的计算机上执行,然后生成客户端代码,再将这些代码发送给浏览网页的客户端。
浏览器完全不懂服务器端的语言。
http://www.thesitewizard.com/html-tutorial/what-is-html.shtml
[转] 学习HTML/JavaScript/PHP 三者的关系以及各自的作用的更多相关文章
- HTML、 CSS、 JavaScript三者的关系 1
HTML. CSS. JavaScript三者的关系 网页主要由三部分组成: 结构( Structure) . 表现( Presentation) 和行为( Behavior) HTML —— ...
- Javascript Prototype __proto__ constructor 三者的关系
JavaScript三大毒瘤 --- this,原型链,作用域 在我等菜鸟一步一步升级中的过程中,这三个概念总是困扰这我们(可能只有我吧,我比较蠢).这三个东西往往都很绕,今天我就来分享一下我对原型. ...
- HTML、 CSS、 JavaScript三者的关系
HTML. CSS. JavaScript三者的关系 网页主要由三部分组成: 结构( Structure) . 表现( Presentation) 和行为( Behavior) HTML ...
- JavaScript学习笔记(2)——JavaScript和DOM的关系
文档对象模型(Document Object Model,简称DOM),是W3C组织推荐的处理可扩展标志语言的标准编程接口.DOM实际上是以面向对象方式描述的文档模型.DOM定义了表示和修改文档所需的 ...
- HTML 学习笔记 JavaScript(面向对象)
现在让我们继续跟着大神的脚步前进 学习一下JavaScript中的面向对象的思想,其实作为一个iOS开发者,对面向对象还是比较熟悉的,但是昨晚看了一下Js中的面向对象,妈蛋 一脸萌比啊.还好有大神.让 ...
- 5月31日 python学习总结 JavaScript概述
JavaScript概述 ECMAScript和JavaScript的关系 1996年11月,JavaScript的创造者--Netscape公司,决定将JavaScript提交给国际标准化组织ECM ...
- JavaScript学习13 JavaScript中的继承
JavaScript学习13 JavaScript中的继承 继承第一种方式:对象冒充 <script type="text/javascript"> //继承第一种方式 ...
- 前端之JavaScript第一天学习(1)-JavaScript 简介
javaScript 是世界上最流行的编程语言. 这门语言可用于 HTML 和 web,更可广泛用于服务器.PC.笔记本电脑.平板电脑和智能手机等设备. JavaScript 是脚本语言 JavaSc ...
- 简述configure、pkg-config、pkg_config_path三者的关系
简述configure.pkg-config.pkg_config_path三者的关系 一.什么是configure 源码安装过程中大多会用到configure这个程序,一般的configure都是一 ...
随机推荐
- yii 验证确认密码是否一致 【"compare",'compareAttribute'=>'password'】
array("surepassword","compare",'compareAttribute'=>'password','message'=>' ...
- 定制linux中的Gtk theme<一>如何设置窗口按钮的多态效果
GTK主题之个人理解: GTK 主题引擎(包含代码所需的图形元素) + 主题配置文件(gtkrc文件)+ 数据资源文件(如图片等) 三者所呈现给用户的视觉风格效果 GTK拥有一套大量的widg ...
- python有序字典实现代码
class MyDict(dict): #有序字典实现 def __init__(self): self.li = [] super(MyDict,self).__init__() def __set ...
- iOS9 未受信任的企业级开发者
升级iOS9,app打不开怎么办?6个步骤让你应对“未受信任的企业及开发者账号” 点开App,弹出未受信任的开发者,记住弹框中冒号后面的大写字母.关闭,进入设置. 进入通用 进入描述文件 找到所对应的 ...
- Flex DataGrid 添加控件
哈喽,又和大家见面了.今天要写的东西是关于Flex DataGrid添加“编辑”或“删除”按钮. 下面是部分代码: <mx:DataGrid id="dgShow" x=&q ...
- oracle timestamp的转换
select to_char(stime,'yyyy-mm-dd HH24:MI:ss.ff3') from e_bmp_log_operation t where t.sdetail like '% ...
- 符合搜索引擎SEO规则的HTML代码
实话说,部落在有时候,也经常会修改一下自己的主题,当然,很多时候,对自己修改过后的主题,会通过查看源代码的方式,来查看自己HTML代码,很多时候,也没有去刻意对代码进行符合搜索引擎SEO规则的优化,而 ...
- js/jquery/插件表单验证
媳妇要学js,就收集一些资料给她. 1.js 表单验证 : http://hi.baidu.com/yanchao0901/item/161f563fb84ea5433075a1eb 2.jquery ...
- Grails架设和配置--起步
现在作这些配置有些轻车熟路了.. 因为RAILS ON RUBY和它真的有很多相像的,, 什么DRY,什么约定先于配置这些的概念... 然后,GITHUB上有好文档,可以一步一步的实践.. https ...
- 【HDOJ】1813 Escape from Tetris
bfs预处理一点到边界的最小距离,IDA*求出可行方案.注意按字典序初始化dir数组.并且存在中间点全为1,边界含0的可能性(wa了很多次).此时不输出任何命令. /* 1813 */ #includ ...