为什么会经常流鼻血| 阳萎吃什么药| 密胺是什么材质| 沙眼衣原体是什么| 星是什么意思| brat什么意思| 诺诗兰属于什么档次| 什么食物维生素b含量高| 血糖高适合吃什么主食| 浮生如梦是什么意思| 食管反流用什么药效果好| 黄喉是牛的什么部位| 去湿气吃什么中药| 苦瓜泡酒有什么功效和作用| 鼻咽癌是什么| 意蕴什么意思| 杀什么吓什么| 短效避孕药是什么| 疣是什么病毒| 感叹号像什么| 小腿发黑是什么原因| 什么是天眼| 小排畸什么时候做| 得宫颈癌的前兆是什么| 皮肤镜能检查出什么| 断眉有什么说法| 一夜白头是什么原因| 芈月和秦始皇是什么关系| lsp是什么意思| 3月21日什么星座| 唐塞是什么意思| 蜜獾为什么什么都不怕| 柚子是什么季节| 土人参长什么样| 什么虫子有毒| 仙人跳是什么意思| 乙肝二四五阳性什么意思| 星期三左眼皮跳是什么预兆| 6月19什么星座| 吃什么对肺结节好| 五彩缤纷是什么意思| 嘴唇出血是什么原因| 小孩子流鼻血是什么原因| 管状腺瘤是什么意思| 湿痹是什么意思| 什么的虾| 谨字五行属什么| 为什么叫清明上河图| 胆结石能吃什么水果| 梅花鹿吃什么| 附属医院是什么意思| 辄的意思是什么| 甘油三酯查什么项目| 广基息肉是什么意思| 什么是骨质增生| 鸡汤炖什么菜好吃| 睡觉流口水什么原因| 弦脉是什么意思| 98年属相是什么| 九牧王男装是什么档次| 一什么| 这是什么虫| 柠檬苦是什么原因| 雅典娜是什么神| 什么杯子不能装水| 动脉硬化挂什么科| 什么是隐形矫正牙齿| 什么生金| 什么肉蛋白质含量最高| 左肺纤维灶什么意思| 什么对眼睛好| 肚脐眼是什么穴位| 巴图是什么意思| 玻色因是什么| 美育是什么意思| 什么茶不能喝脑筋急转弯| 924是什么星座| 招字五行属什么| 呈现是什么意思| 开通花呗有什么风险| 过期药品是什么垃圾| 天文是什么意思| 睡不醒是什么原因| tod是什么| 麻黄是什么| 咽炎吃什么药最好效果| 闪购是什么| 房颤什么意思| 为什么没有win9| 多潘立酮片是什么药| 世界上最大的单位是什么| 可逆是什么意思| 贤上腺瘤是什么意思| 吃什么好| 吃海带有什么好处| 腮腺炎反复发作是什么原因| 什么样的红点是艾滋病| 石头五行属什么| 经信委是干什么的| meta分析是什么| 刻舟求剑什么意思| 九月十号是什么星座| 小便黄是什么病症| 金鱼可以和什么鱼混养| 什么植物和动物像鸡| 吃什么白细胞升的最快| 米肉是什么| 云南雪燕有什么作用| 病危通知书意味着什么| 小孩肛门瘙痒什么原因| 826是什么星座| cba是什么| 蛇五行属什么| 迪丽热巴什么星座| 孕妇鼻炎犯了可以用什么药治疗| 绩效工资是什么意思| 唯女子与小人难养也什么意思| 前列腺液和精液有什么区别| 欲壑难填什么意思| cbd是什么| 鸡吃什么长得又快又肥| 眼睛干痒用什么眼药水| 轻微食物中毒吃什么药| 近亲为什么不能结婚| 吃什么药升血小板最快| 11点半是什么时辰| 白脉病西医叫什么病| 肚子疼去医院挂什么科| 胖大海和什么搭配最好| 罗网是什么意思| 孙红雷的老婆叫什么名字| 胎儿缺氧孕妇会有什么反应| 慢性病是什么意思| 热淋是什么意思| 我操是什么意思| 失聪什么意思| 七月九号是什么星座| 薄荷与什么相克| 鼻咽癌是什么| 讽刺是什么意思| 胖大海配什么喝治咽炎| 尖货是什么意思| 脑子萎缩是什么原因造成的| 梦见在水里游泳是什么意思| 气罐和火罐有什么区别| 经常放臭屁是什么原因| 胃胀消化不好吃什么药| 夜间睡觉流口水是什么原因| 什么的图案| 宝宝什么时候开始长牙| 野什么意思| edd什么意思| 什么生肖不认识路| 鸡的贵人是什么生肖| 什么蔬菜补铁效果最好| pd950是什么金| 身体缺钾有什么症状| 梦见芹菜是什么意思| 哺乳期吃避孕药对孩子有什么影响| 398是什么意思| cnb是什么意思| 什么是pp材质| 鸟在家里做窝预示什么| 我知道你在想什么| 微波炉里不能放什么| 瞬息什么| 突然耳朵聋是什么原因| 什么时候放开二胎| rgp是什么| 天衣无缝是什么意思| 科普一下是什么意思| 木人石心是什么意思| 维生素c十一什么意思| 思是什么生肖| 西瓜为什么是红色的| 冰箱什么牌子好又省电质量又好| 迟钝是什么意思| 7月份适合种什么菜| 皂角是什么| 高丽参是什么参| 四点水的字与什么有关| 梦见要账是什么意思| 人出现幻觉是什么原因| 为什么会有| 手心有痣代表什么意思| 喝什么养胃| 脾气是什么意思| 食物中毒拉肚子吃什么药| 小康生活的标准是什么| 子宫瘢痕憩室是什么病| 三月十五是什么星座| 海参吃了有什么好处| 胸贴是什么| 做活检意味着什么| 玉米须有什么作用| 白肺是什么| 为什么血脂会高| 苍蝇吃什么| 腰脱什么症状| 铁马是什么| 4月19号是什么星座| 猫传腹是什么病| 取其轻前一句是什么| 医院手环颜色代表什么| 减肥可以吃什么主食| 土加一笔是什么字| dew是什么意思| 手淫有什么坏处| 东南方是什么生肖| 西瓜禁忌和什么一起吃| 化疗期间吃什么最好| 梦见自己搬家是什么意思| 结扎后需要注意什么| 28年是什么婚| 痛苦的反义词是什么| 喝碱性水有什么好处| 手指代表什么生肖| 打狗看主人打虎看什么答案| 正财代表什么| 总是想睡觉是什么原因| 心脏跳动过快吃什么药| 松香对人体有什么危害| 羊排和什么一起炖好吃| 章鱼的血液是什么颜色| 中国最好的大学是什么大学| 鱼跳出鱼缸有什么征兆| 甜醋是什么醋| icu什么意思| 汆是什么意思| 不放屁是什么原因| 1968年五行属什么| 九宫八卦是什么意思| 9月3日是什么纪念日| 月台是什么意思| 喝酒有什么危害| 没胃口吃点什么好| 猪八戒的真名叫什么| 代孕什么意思| 基点是什么意思| 乳房结节吃什么药| 手足口不能吃什么食物| 痛经喝什么能缓解| 忌什么意思| 什么叫县级以上的医院| 幽门螺旋杆菌感染是什么意思| 多汗是什么原因| 精彩是什么意思| 策反是什么意思| 1994年的狗是什么命| 驻村是什么意思| 曼陀罗是什么意思| 什么叫贫血| tommyhilfiger什么牌子| 5月10日是什么星座| 仟字五行属什么| 话赶话是什么意思| 幽门螺旋杆菌吃什么药| 田七和三七有什么区别| 左手大拇指麻木是什么原因| 40岁男人学什么乐器好| 警备区是干什么的| 牙疼是什么原因引起的| 左小腹疼是什么原因| 吹是什么意思| 百度Jump to content

黄金周模式迅速转入淡季 热门旅游线路价格直线下降

From Wikiversity
Web Design Getting to know JavaScript events
This page is part of the Web Design project.
百度 根据中国信托业协会发布的数据显示,截至2017年三季度,全行业管理信托资产规模继续保持稳健增长,三季度末信托资产余额万亿元,比二季度末万亿元增加了万亿元。

OK: Sorry this isn't formatted yet or presented nicely - but it's late and I want to get away from the computer! Feel free to update it!

We're going to start our JavaScript experience by getting to know our browser window a bit better... before you know it, you'll be able to describe what:

window.alert('Hey there');

is all about, you'll be able to describe a few events that your web browser allows you to use, and you'll be able to make those annoying popup ads happen!

Getting Started

[edit | edit source]

If you haven't already, it would be a good idea to follow through the excellent intro tutorial Intro to programming (including Part 2) either before starting this activity, or after the activity to help bring some of the ideas together.

You may also want to print out the Javascript Cheat Sheet - but don't be overwhelmed by the amount of info that's been squashed onto this one sheet... grab your highlighter and highlight the following bits to start with:

  • Under 'Window' (at the bottom left of the page), highlight 'alert' and 'open'
  • the entire "Event Handlers" section.

Now simply:

  1. choose an HTML file that you've been working on lately,
  2. take a copy of it (and it's stylesheet if it has one),
  3. and open the HTML file up in your favourite editor.

You're ready to go!

Your first Javascript

[edit | edit source]

Pick a paragraph of your choice and modify the opening tag so it looks like this:

  <p onclick="window.alert('Hi there');">

Leave the rest of your paragraph (the text and the closing tag) as is. View your page and click on that paragraph. Simple?

You may put the above javascript statement on other attributes of the <p> (paragraph) tag. Try putting the same statement on "onkeydown" or for that matter "onmousedown". So your paragraph html will look like.

  <p onmousedown="window.alert('Hi there');">

Now the trigger will occur when the mouse button is pressed down. Just continue experimenting.

For your information you may put the same effect on any object (button, hyperlink) on the page. Here goes another (though slightly complicated) example (from working application code) for you to understand.

<a href="Javascript:onClick=clearstuff()"><img src="../../images/resetstuff.jpg" border="0"></a>

Firstly we have the html tag for link <a href... that provides a link over the image resetstuff.jpg, it programs the browser to call the js method clearstuff() when the image is clicked.

This is a simple way of creating you custom buttons.

Now here you can have the same action by not using the <a href> tag. Try finding out how (Hint look at the properties of img tag).


A good way is to use a html editor. It will show the available attributes on a tag automatically in a drop down as you type. It's an easier way to code. For learning though you may still prefer to use a text editor.


(Re)-read over how-to-build-website's explanation of this window.alert statement before going any further... and if you're in class, make sure you talk about what exactly is going on!

Activities

[edit | edit source]
  1. Modify your code so that it says 'Hi [yourname]' (using your own name) and test it!
  2. Use your cheat sheet to see if you can add some similar code to another paragraph, but this time modify the code so that you don't need to click on the paragraph, but can simply roll the mouse over it.
  3. Have a go at modifying your page so that when it first loads, it pops a message saying "Welcome to my site!"
  4. Lastly, using your cheat sheet, see if you can modify your page so that when you click on a certain paragraph, it closes your window!

Opening a new browser window

[edit | edit source]

Your first challenge is to see if you can modify your page so that when you click on a paragraph, it will open a new browser window!

Activities

[edit | edit source]

Once you've got that working, try the following:

  1. Modify your code so that a popup window displays as soon as your page is loaded (Hint: you'll need to use the 'onload' event on your body element).
  2. See if you can find out a bit more about the window.open method so that you can set the size of your window and make sure it looks like a real ad by getting rid of all the guff (menus, address bar etc). Hint: You'll need to do a bit of research to find out more, try using google!
  3. Modify your code so that when your page loads, three small windows open up at different points on the screen, all without toolbars etc.

Now you know how to create annoying popup ads!

8月是什么月 脊柱侧弯有什么危害 早上尿黄是什么原因 孔子的真名叫什么 208是什么意思
女人出轨有什么表现 望周知是什么意思 齿加禹念什么 宰相的宰最早指什么 波折是什么意思
什么是琥珀 qq2g在线是什么意思 男人肾虚吃什么好 足字旁的字与什么有关 例假发黑是什么原因
marisfrolg是什么牌子 梅毒抗体阳性说明什么 四级什么时候报名 脾围是什么意思 琮字五行属什么
海笋是什么东西hcv9jop5ns5r.cn 28岁属什么生肖hcv7jop6ns1r.cn 3月4号什么星座hcv9jop4ns1r.cn 胃体息肉是什么意思hcv8jop7ns0r.cn 黄体可能是什么意思啊hkuteam.com
免疫球蛋白低说明什么hcv9jop5ns0r.cn 吃茴香有什么好处和坏处sanhestory.com 淋巴结增大是什么原因严重吗hcv7jop7ns4r.cn 嘴唇干是什么原因引起的hcv8jop6ns3r.cn 东坡肉属于什么菜系aiwuzhiyu.com
腋下黑是什么原因hcv8jop3ns1r.cn hushpuppies是什么牌子hcv9jop7ns1r.cn 观音土是什么hcv8jop2ns3r.cn 干事是什么意思hcv9jop5ns5r.cn 大校相当于政府什么官hcv8jop7ns9r.cn
氯硝西泮片是什么药hcv8jop2ns3r.cn 蝙蝠是什么变的hcv8jop9ns6r.cn 什么是幻听hcv9jop6ns8r.cn 肚脐左上方是什么部位hcv8jop3ns8r.cn 碱性磷酸酶高吃什么药jingluanji.com
百度