javascript是什么

原文p2pu:http://new.p2pu.org/en/groups/javascript-101/content/week1/

js是能被浏览器理解的代码。

你可以在浏览器地址栏输入

javascript: alert("Hi, I'm a program.");

然后回车,祝贺你,已经运行了一个js程序。

Now hop over to http://goo.gl/wYwXx and paste

alert("Hi, I'm a program.");

into the left hand window and press preview (the emulation runs the code) and you see the same result as previously.

Now make a copy of the html in the right window and save it to a html file on your own computer, use it as a template for testing, assignments and so on.

So how and where in your html template do you put the javascript? Like other things that go in Html pages Javascript has its own set of opening/closing tags and the code goes between them like this:

<script type="text/javascript"> alert("Hi, I'm a program."); </script>
and then very often (not always) the above is inserted between the head tags on the page. Try it now, paste the above anywhere between the head tags in a copy of your template and open it in your browser.

However the best way is to put the javascript code in its own file so make up a file with extension .js and put the code in there and store the file in the same folder as your template, then in your template file make a call to that file like this:

<script type="text/javascript" src="yourfile.js"> </script>
Now if you open the file in the browser, the code gets executed just as previously. This is the same way that third party libraries such as JQuery get called. ( Don't worry right now if you don't know what a library or JQuery is ). Notice that this is also what is happening in JS Bin, the code is being executed as if it were in a separate file.

The program consists of a statement which is a call to the function that is the value of the property named alert of the global object. If this doesn't make too much sense to you right now, all will become clear later on.

Next listen to Douglas Crockford's video at http://yui.zenfs.com/theater/crockford-tjpl-1.m4v

Now do the javascript presentation and assignment at http://bit.ly/eANeSx (those of you feeling a bit rusty on html or css should have a look at those presentations as well).

Start working your way through the List of Examples Online for sections 1.1 thru 2.5 . (Alternate link http://umust.be/js101/index.html). You should have some familiarity with all these lessons as soon as you possibly can.
[[--- Javascript, managed by the Mozilla Foundation, as of 27 July 2010 in version 1.8.5, is an implementation (dialect) of ECMA-262 Edition 5 (aka ECMAScript5) of 3 December 2009; support for this version exists in FF4, IE9, Safari5 and Chrome10. Older browsers would have support for Edition 3.

Although not strictly correct, most people when using the word "javascript" mean any implementation in browsers, not only that of Mozilla Foundation; in fact, Javascript is now an Oracle trademark.

http://kangax.github.com/es5-compat-table/
http://kangax.github.com/es5-compat-table/non-standard/---]]

Then put up a page on your site with answers to the following and any other thoughts you might have had up to now:-


When parsing a String into a number using the parseInt() method, we are advised to always provide the radix. Why is this?
Why do we lose precision when performing operations with decimal numbers in Javascript? Can you think of a few implications of why this would be a problem?
Do you understand why the next operation produces the given result 115 * 4 - 4 + 88 / 2 = 500?
What is a type, and why do you think types are useful in writing programs?
What does typeof(4.5); do, and why does typeof(typeof(4.5)); return "string" ?
"+" in Javascript is overloaded, what does this mean?
You might be interested in how your peers commented on this and other matters in the previous incarnation of this course, here http://bit.ly/hic9F4.



http://goo.gl/saHWg Web development - twenty six concepts or technologies.

http://goo.gl/xVu6Y Beginner best practices.

http://goo.gl/lztxB Javascript Primitive Types

http://goo.gl/t6teZ Javascript Composite Types

http://goo.gl/DTsJc Another Intro
Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值