Experimental investigation of a domestic solar water heater with solar collector coupled phase-change energy storage
H.Sheng Xue
Jiangsu Provincial Supervising and Testing Research Institute for Products Quality,5East Guang Hua Street,Nanjing,SU210007,China
a r t i c l e i n f o
Article history:
Received29April2015
Received in revised form
6August2015
Accepted7August2015
Available online xxx
Keywords:
Constant?ow rate
Exposure
Thermal energy storage
Domestic solar water heater
All-glass evacuated tubular solar collector System ef?ciency a b s t r a c t
Phase change materials(PCMs)have good properties such as high thermal capacity and constant phase change temperature.Their potential use in solar energy storage is promising.Tests of exposure and constant?ow rate are performed to investigate the thermal performance of a domestic solar water heater with solar collector coupled phase-change energy storage(DSWHSCPHES).Due to the low thermal conductivity and high viscosity of PCM,heat transfer in the PCM module is repressed.The thermal performance of the DSWHSCPHES under exposure is inferior to that of traditional water-in-glass evac-uated tube solar water heaters(TWGETSWH)with an identical collector area.DSWHSCPHES also per-forms more ef?ciently with a constant?ow rate than under the condition of exposure.Radiation and initial water temperature have impacts on system performance;with the increase of proportion of diffuse to global radiation and/or initial water temperature,system performance deteriorates and vice versa.
?2015Elsevier Ltd.All rights reserved.
1.Introduction
PCM is characterized by high thermal capacity and constant phase change temperature.It has the promising potential of elim-inating the mismatch between supply and demand,reducing storage volume,lowering cost,lengthening nocturnal service time, and intensifying thermal performance.Extensive researches about the application of PCM in integrated collector storage solar systems and domestic solar water heater components d collector,tank,and heat transfer loop,for example d have been undertaken.Both bene?cial impact and undesired effects have been presented in works of scholars,making the introduction of PCM into solar storage systems a controversial issue.
For an integrated collector storage solar water heating system, the use of PCM leads to a decrease of thermal ef?ciency[1,2].The improvement of insulation enhances solar energy accumulation, lengthens nocturnal service time,and boosts water temperature [3,4].The system ef?ciency increases incrementally with the ther-mal conductivity of PCM and of the water?ow rate;outlet temperature?uctuation decreases if the heat transfer pipes are placed deeper in the storage material[5,6].
The research results on PCM coupled solar collectors are con-tradictory.It is observed that the use of PCM decreases thermal loss and thus system ef?ciency improves by up to11%[7].Thermal performance factors such as useful energy and nocturnal service time are intensi?ed[8e10].However,annual performance is penalized by low ef?ciency during the winter season[11].Re-searchers argue that traditional collectors perform better than ones coupled with PCM due to their low thermal conductivity and high viscosity[12].
The exploitation of PCM in water tanks enhances its thermal energy density and capacity,compensating the increase of heat loss.Investigations show that introduction of PCM results in extension of the period of higher temperature water storage,vol-ume reduction of the required water tank,and leveling the mismatch between energy supply and demand[13e23].But ex-periments and mathematical optimization show a magni?ed?uc-tuation of water tank temperature,strati?cation degradation,and increased nocturnal heat loss.Thermal performance improvement is not relevant[24,25].This can be remedied by carefully selecting the thermal PCM parameters,parametric intensi?cation,and optimal design of the water tank[26e29].
Extra energy may also be stored in a PCM module installed in the heat transfer solar loop with a modi?ed control system.Parametric
Abbrevations:PCM,phase change material;DSWHSCPHES,Thermal perfor-mance of domestic solar water heater with solar collector coupled phase-change energy storage;TWGETSWH,traditional water-in-glass evacuated tube solar wa-ter heaters.
E-mail address:10408027@https://www.wendangku.net/doc/704309375.html,
.
Contents lists available at ScienceDirect
Renewable Energy
journal h omepage:w
https://www.wendangku.net/doc/704309375.html,/locate/renene
https://www.wendangku.net/doc/704309375.html,/10.1016/j.renene.2015.08.017
0960-1481/?2015Elsevier Ltd.All rights reserved.
Renewable Energy86(2016)257e261
analysis shows that the solar fraction of a solar water heater with a water tank volume of 0.01m 3can be signi ?cantly improved from 42.4%to 48.5%by introducing a PCM module with a volume of 0.02m 3.Moreover,water tank volume obtains a 40%reduction while maintaining a high solar fraction [30].
Comprehensive investigation and laborious works are still needed to clarify the feasibility of introducing PCM in domestic solar water heaters.In light of this,exposure and constant ?ow rate tests are performed upon a DSWHSCPHES to probe its thermal performance.
2.Experimental procedure
Thermal performance tests of the solar collector are conducted on the test rig,which is schematically illustrated in Fig.1.It consists of a water tank,a solar collector,piping,and a data acquisition system.The solar collector is of an all-glass evacuated tubular type,and its area is 1.272mm 2.The core component of the solar collector,the collector tube,is 1800mm long.The outer diameter of the tube is 58mm.On the outer surface of the inner glass tube,Cu/Al/stainless steel is magnet-sputtered as solar selective coating.There are 10tubes in the collector.Inside each collector tube,PCM storage unit is built in.The diameter,wall thickness,and length of the unit are 42.16mm,1.53mm,and 1.720mm,respectively.The main part of the PCM is Ba(OH)2$8H 2O.A small amount of BaCO 3is used as nucleant (Figs.3e 5).The thermal properties of the PCM are sum-marized in Table 1.Solar energy is absorbed by the solar selective coating.Via conduction and convection and radiation,it is
transferred to the PCM unit.Then,fusion of the PCM occurs inwardly.A U-shaped copper tube with a diameter of 8mm and a wall thickness of 0.8mm is embedded in the PCM (Fig.2).The heat transfer ?uid,water,?ows through the copper tube and converges at the manifold with a diameter of 15mm and a wall thickness of 1.0mm.Energy transfer is relayed by water ?ow in the embedded copper tube to the water tank with a volume of 90L.
Preconditioning of the test rig is performed prior to each per-formance test.The solar collector is shaded from the solar beam.Valves at the locations of 2and 11are turned off.Water ?ows at a constant temperature in the pipeline from three-pass 3across the solar collector till water temperature is equal at valves 6and 10.The exposure test starts at 8:00am by removing the shade from the solar collector.Radiation is logged by a data acquisition system.The exposure test ends at 4:00pm.The valves at the two ends of the manifold are turned off.Three-passes 2,10,and 11are turned on,and the water tank is ?lled through three-pass 3.When the water tank is full,three-pass 3and valve 10are shut down.The valves at the two ends of the solar collector manifold are turned on.The pump is started,and water is circulated through the test rig.The ?ow rate of the heat transfer ?uid is regulated to a value of 1.53L/min.When the temperature at locations 2and 11stabilizes,the temperatures are tabulated.
The constant ?ow rate test starts by preconditioning the test rig with a constant ?ow rate of 0.02kg/(m 2s)with the solar collector shielded.When the whole system obtains a uniform temperature,the shade over the solar collector is removed.The test is run from 8:00am to 4:00pm.
The thermal performance of the solar system is evaluated by the useful energy obtained and system ef ?ciency,which are formulated below.
Q u ?CM D T ?CM eT o àT i T(1)h ?
Q u
G
?100%(2)
3.Results and discussion
The energy ef ?ciency variation of the TWGETSWH vs.the ratio of tank volume to collector area is demonstrated in Fig.6.The typical water heater is characterized by tank volume/collector area of 50e 54kg/m 2,daily useful energy of 7.5e 7.7MJ,and ef ?ciency of 44e 45%.Also,it is shown that as the ratio of tank volume to col-lector area increases,the system energy ef ?ciency improves.
With regard to this work,the ratio of the tank volume to col-lector area amounts to 70kg/m 2.For a TWGETSWH,the energy ef ?ciency could amount to about 52%.However,the daily useful energy,maximum ef ?ciency,and average system ef ?ciency ob-tained by exposure test are 6.4MJ,41%,and 37%,respectively.As for the constant ?ow rate test the parameters mentioned above are 10MJ,59%,and 57%(Table 2).Compared to the TWGETSWH,the thermal performance of the one with PCM under exposure is inferior.However,when the solar water heater runs at a constant ?ow rate,excess energy can be stored in the PCM and this excess energy reheats the water of the system as time precedes and solar radiation attenuates.Accordingly,the solar water heater with PCM performs better than the traditional one.
Solar irradiance lessens with time after noon.However,the water temperature in the storage tank keeps rising constantly till about 1h before the end of the constant ?ow rate test.Then the temperature reaches a climax and stabilizes afterwards (Fig.7).The constant fusion temperature,which characterizes a phase change material,is not shown itself in the temperature pro ?le because the presence of barium carbonate does not effectively boost the
growth
Fig.1.Schematic diagram of the test rig.(1.Water storage;2,11.Temperature sensor;3.Three-way valve;4.Pump;5.Flow meter;6.Valve;7.All-glass evacuated tubular solar collector;8.Pyranometer;9.Shaded pyranometer;10.Safety
valve).
Fig.2.Schematic diagram of thermal energy storage unit using Ba(OH)2$8H 2O as PCM.
H.S.Xue /Renewable Energy 86(2016)257e 261
258
of the nucleus,which results in serious supercooling of the PCM (Fig.5and Table 1).Radiation is distributed asymmetrically on the collector tube surface.The upper part of the collector tube receives a large portion of the beam radiation.Thus,fusion of the PCM proceeds inward and downward.The PCM at the upper perimeter of the storage unit melts ?rst.The melted PCM ?oats on the solid material and maintains a stagnant state.Convection is suppressed.
Heat transfer is by way of conduction only.Due to the low thermal conductivity of the solid PCM and high viscosity of the liquid PCM,heat transfer in the PCM unit is https://www.wendangku.net/doc/704309375.html,pared to the case of the constant ?ow rate test,the temperature of the PCM undergoing the exposure test is high.Then the heat loss increases and the thermal ef ?ciency of the solar water heater decreases.
Diffuse radiation has an impact on the solar water system.Table 2shows that system ef ?ciency decreases with the proportion of diffuse to global radiation.This explains partly why,compared to the results from the exposure test,the system ef ?ciency of the constant ?ow test is 20%higher.Moreover,the initial water tem-perature in ?uences system performance,too.The lower the initial water temperature,the higher the temperature potential and the thermal performance will be.4.Conclusion
Due to the low thermal conductivity and high viscosity of the PCM,and absent intensi ?cation of thermal conductivity and heat transfer,heat transfer in the PCM module is repressed;thermal performance of the DSWHSCPHES under exposure is inferior to that of the TWGETSWH with an identical collector area and to the col-lector running at a constant ?ow rate test.
Radiation and initial water temperature have impacts on system performance;increasing the proportion of diffuse to global radia-tion and/or initial water temperature causes system performance to deteriorate and vice
versa.
Fig.3.X-ray diffraction of the PCM;ds with values of 3.702,3.236,2.618,1.928,and 1.936indicate the presence of
BaCO3.
Fig.4.Fourier translation infrared spectroscopy of the
PCM.
Fig.5.Differential scanning calorimetry of the
PCM.
Fig.6.Energy ef ?ciency variation of the TWGETSWH vs.ratio of tank volume to col-lector area.
H.S.Xue /Renewable Energy 86(2016)257e 261259
Nomenclature and units C effective thermal capacity,Jm à2K à1G solar irradiance,W/m 2M mass,kg
D T temperature difference, C
Q u useful energy gained by solar water heater,J T o outlet temperature, C T i
inlet temperature, C
h
system thermal ef ?ciency
References
[1]P.C.Eames,P.W.Grif ?ths,Thermal behaviour of integrated solar collector/
storage unit with 65 C phase change material,Energy Convers.Manag.47(2006)3611e 3618.
[2]J.Prakash,A solar water heater with a built-in latent heat storage,Energy
Convers.Manag.25(1)(1985)51e 56.
[3]Ahmet Kürklü,Aziz €Ozmerzi,Sefai Bilgin,Thermal performance of a water-phase change material solar collector,Renew.Energy 26(2002)391e 399.
[4]K.S.Reddy,Thermal modeling PCM-based solar integrated collector storage
water heating system,J.Sol.Energy T.ASME 129(2007)458e 464.
[5]Ashok Kumar Bhargava,A solar water heater based on phase-changing ma-terial,Appl.Energy 14(1983)197e 209.
[6]G.N.Tiwari,S.N.Rai,Sant Ram,Madan Singh,Performance prediction of PCCM
collection-cum-storage water heater:quasi-steady state solution,Energy Convers.Manag.28(3)(1988)219e 223.
[7]Saw Chun Lin,Hussain H.Al-Kayiem,Mohd Shiraz Bin Aris,Experimental
investigation on the performance enhancement of integrated PCM-?at solar collector,J.Appl.Sci.12(23)(2012)2390e 2396.
[8]Gianluca Serale,Sara Baronetto,Francesco Goia,Marco Perino,Characteriza-tion and energy performance of a slurry PCM-based solar thermal collector:a numerical analysis,Energy Procedia 48(2014)223e 232.
[9]Yasin Varol,Ahmet Koca,Hakan F.Oztop,Engin Avci,Forecasting of thermal
energy storage performance of phase change material in a solar collector using soft computing techniques,Expert Syst.Appl.37(2010)2724e 2732.[10]N.Khalifa Abdul Jabber,Raid A.Abdul Jabbar,Conventional versus storage
domestic solar hot water systems:A comparative performance study,Energy Convers.Manag.51(2010)265e 270.
[11] D.Haillot,F.Nepeu,V.Goetz,X.Py,M.Benabdelkarim,High performance
storage composite for the enhancement of solar domestic hot water systems Part 2:numerical system analysis,Sol.Energy 86(2012)64e 77.
[12]Saffa Riffat,Liben Jiang,Jie Zhu,Guohui Gan,Experimental investigation of
energy storage for an evacuated solar collector,Int.J.Low Carbon Technol.1/2(2006)139e 148.
[13] A.A.Ghoneim,Comparison of theoretical models of phase-change and sensi-ble heat storage for air and water-based solar heating systems,Sol.Energy 42(3)(1989)209e 220.
[14] A.Castell,C.Sol e
,M.Medrano,M.Medrano,M.Nogu e s,L.F.Cabeza,Com-parison of strati ?cation in a water tank and a PCM-water tank,J.Sol.Energy T.ASME 131(2009)024501.
[15]Yoram L.Shabtay,John R.H.Black,Compact hot water storage systems
combining copper tube with high conductivity graphite and phase change materials,Energy procedia 48(2014)423e 430.[16] Alvaro Camops-Celador,Gonzalo Diarce,Jon Ter e
s Zubiaga,Tatyana V.Bandos,Ane M.García-Romero,L.M.L o
pez,Jos e M.Sala,Design of a ?nned plate latent heat thermal energy storage system for domestic application,Energy Procedia 48(2014)300e 308.
[17]Dan Nchelatebe Nkwetta,Pierre-Edouard Vouillamoz,Fariborz Haghighat,
Mohamed El-Mankibi,Alain Moreau,Ahmed Daoud,Impact of phase change materials types and positioning on hot water tank thermal performance:using measured water demand pro ?le,Appl.Therm.Eng.67(2014)460e 468.
[18] A.de Gracia,E.Or o
,M.M.Farid,L.F.Cabeza,Thermal analysis of including phase change material in a domestic hot water cylinder,Appl.Therm.Eng.31(2011)3938e 3946.
[19]H.Mehling,L.F.Cabeza,S.Hippeli,S.Hiebler,PCM-module to improve hot
water heat stores with strati ?cation,Renew.Energy 28(2003)699e 711.
[20]Luisa F.Cabeza,Manuel Ib a ~n
ez,Cristian Sol e ,Joan Roca,Miquel Nogu e s,Experimentation with a water tank including a PCM module,Sol.Energy Mat.Sol.Cells 90(2006)1273e 1282.
[21]Suat Canbazo g
lu,Abdulmuttalip Sahinaslan,Ahmet Ekmekyapar,Y.G €o
khan Aksoy,Fatih Akarsu,Enhancement of solar thermal energy storage performance using sodium thiosulfate pentahydrate of a conventional solar water-heating system,Energy Build.37(2005)235e 242.
[22]Mohammad Ali Fazilati,Ali Akbar Alemrajabi,Phase change material for
enhancing solar water heater,an experimental approach,Energy Convers.Manag.71(2013)138e 145.
[23]I.Al-Hinti,A.Al-Ghandoor,A.Maaly,I.Abu naqeera,Z.Al-Khateeb,O.Al-Sheikh,Experimental investigation on the use of water-phase change material storage in conventional solar water heating systems,Energy Convers.Manag.51(2010)1735e 1740.
[24]T.Kouskwou,P.Bruel,G.Cherreau,V.Leoussoff,T.El Rha ?ki,PCM storage for
solar DHW:from an unful ?lled promise to a real bene ?t,Sol.Energy 85(2011)2033e 2040.
[25]Ella Talmatsky,Abraham Kribus,PCM storage for solar DHW:an unful ?lled
promise?Sol.Energy 82(2008)861e 869.
[26]Roberta Padovan,Marco Manzan,Genetic optimization of a PCM enhanced
storage tank for solar domestic hot water systems,Sol.Energy 103(2014)563e 573.
Table 2
Thermal performance of a DSWHSCPHES.Tests condition Test number Daily useful energy (kJ)Ef ?ciency Diffuse/global irradiance Exposure
16375.5070.4078240.178********.2580.3355760.20373735520.1640.3601120.180768Constant ?ow rate
110019.190.5855410.14230628643.8610.5885380.1489753
8007.064
0.532208
0.189764
Fig.7.Water temperature curve in the tank obtained from the exposure test.
Table 1
Thermal properties of the PCM.Fusion
Solidi ?cation
Enthalpy (kJ kg à1)Onset ( C)Peak ( C)Enthalpy (kJ kg à1)Onset ( C)Peak ( C)193.0
77.98
81.83
57.8
52.65
52.36
H.S.Xue /Renewable Energy 86(2016)257e 261
260
[27]Mehmet Esen,Teoman Ayhan,Development of a model compatible with solar
assisted cylindrical energy storage tank and variation of stored energy with time for different phase change materials,Energy Convers.Manag.37(12) (1996)1775e1785.
[28]Mehmet Esen,Aydin Durmus,Ayla Durmus,Geometric design of solar-aided
latent heat store depending on various parameters and phase change
materials,Sol.Energy62(1)(1998)19e28.
[29]Mehmet Esen,Thermal performance of a solar-aided latent heat store used for
space heating by heat pump,Sol.Energy69(1)(2000)15e25.
[30]Didier Haillot,Erwin Franquet,St e phane Gibout,Jean-Pierre B e d e carrats,
Optimization of solar DHW system including PCM media,Appl.Energy109 (2013)470e475.
H.S.Xue/Renewable Energy86(2016)257e261261
JavaScript制作页面特效课后练习 1.在某页面中有一个图片和五个超链接,如下图所示,单击不同的数字超链接显示不同的 图片: 图1 图片幻灯片显示效果 提示: (1)默认显示一个图片,五个超链接调用同一个传参函数,参数设置为显示图片的名称。 (2)使用“对象名.属性值”或setAttribute()的方式改变图片的名称。 2.做一个模仿删除用户的页面,功能如下: 默认情况下,在一个Table 里面放置若干用户信息,后面有“删除”链接:
图2 模仿删除用户的页面效果1 点击“删除”链接,弹出对话框,提示用户是否继续操作: 图3 模仿删除用户的页面效果2 用户点击确定后,要删除的一行,自动加上删除线,表示处于删除状态: 图4 模仿删除用户的页面效果3 提示: (1)使用confirm 弹出确认框,如果用户点击“确定”,则返回true,进行下一步操作; (2)定义一个类样式,用来标识删除状态,如果用户点击了“确定”按钮之后,该行所对 应的tr 标签,自动应用该类样式。 3.做一个横向导航菜单,并且每一项均包含一个二级的菜单,效果图如下:
图5 横向导航菜单 当鼠标不在菜单上时,二级菜单不显示,当鼠标移动到任一项上时,显示该项对应的二级菜 单。 提示: (1)使用对象的display 属性可以控制对象的显示与隐藏; (2)使用相对定位/绝对定位来控制二级菜单的显示位置; (3)使用鼠标的两个事件(onmouseove/onmouseout)来触发控制函数。 4.做一个横向不间断滚动的特效,效果图如下:
图6 图片横向滚动特效 要求:图片始终横向向左滚动,并且每一张图片首尾相连,不存在间断。 提示: (1)若要使图片不间断,则需要将图片列表重复一次,这样第一遍的末尾图片和第二遍的 开始图片就能相连了,即使用innerHTML 属性让图片内容翻倍;(2)使用setInterval()方法,可以控制一个函数每隔多少毫秒执行一次; (3)使用绝对定位与相对定位结合,可以使图片所在的层相对于父层的位置可控,方便随 着计时器的执行,left 的值递减;
《HTML+CSS+JavaScript网页制作案例教程》课程教学大纲 (课程英文名称) 课程编号:201509210011 学分:5学分 学时:64学时(其中:讲课学时:45 上机学时: 19 ) 先修课程:计算机基础、计算机网络、计算机应用 后续课程:UI设计、 JavaScript网页特效 适用专业:信息及其计算机相关专业 开课部门:计算机系 一、课程的性质与目标 《HTML+CSS+JavaScript网页制作案例教程)》是面向计算机相关专业的一门专业基础课,涉及网页基础、HTML标记、CSS样式、网页布局、JavaScript 编程基础与事件处理等内容。通过本课程的学习,学生能够了解HTML、CSS及JavaScript语言的发展历史及未来方向,熟悉网页制作流程、掌握常见的网页布局效果、学会制作各种企业、门户、电商类网站。 二、课程的主要内容及基本要求 第一章网页那点事(2学时) [知识点] 认识网页 常见的互联网专业术语 Web标准 HTML简介 CSS简介 JavaScript简介 常用浏览器介绍 Dreamweaver 工具的使用
使用Dreamweaver创建第一个页面 [重点] Web标准 Dreamweaver工具的使用 [难点] Web标准 Dreamweaver工具创建第一个页面 [基本要求] 了解Web标准,明确HTML、CSS及JavaScript在其中的作用。 熟悉Dreamweaver工具的基本操作,能使用Dreamweaver创建简单的网页。第二章从零开始构建HTML页面(4学时) [相关案例] 【案例1】简单的网页: 【案例2】新闻页面: 【案例3】图文混排: [知识点] HTML文档基本格式
《网页设计与制作项目教程()(一般)》试卷 得分 一、单选题(每题2分,共计30分) 1.关于<>标记的描述,下列选项中正确的是()。() A、是表格中的单元格标记 B、可以单独使用 C、是表格中的行标记 D、没有属性 2.若超链接的属性,需要链接到页面中的锚点,以下书写正确的是()() A、 B、 C、 D、 3.中,通过链接伪类可以实现不同的链接状态。下列用来定义未访问时超链接状态的是()()A、 B、 C、 D、4.下列有关样式,说法正确的是()。() A、样式必须写在一对;标签内部 B、用于设置页面中的文本内容、图片的外形以及版面的布局等外观显示样式 C、只有外部的文件才是符合结构与表现分离的特点 D、目前流行的版本为3 5.下列样式代码中,可以实现相对定位模式的是()。() A、: ; B、: ; C、: ; D、: ; 6.关于样式代码“{:200; :15; :20;}”下列说法正确的是()。() A、的总宽度为200 B、的总宽度为270 C、的总宽度为235 D、以上说法均错误 7.关于行内式引入样式表,以下书写正确的是()() A、 :12; ;段落文本; B、 :12, ;段落文本; C、 :12; ;段落文本; D、 :12; ;段落文本; 8.使用标签指定式选择器,让段落应用名为的类,下列写法正确的是( )() 总分题号一二三四五题分 得分
A、 {;} B、{;} C、{;} D、{;} 9.下列选项中,调用名为"" 的函数正确的是()() A、 B、() C、() D、 10.认真阅读下面代码,并按要求进行作答。1=" a "2=" "312;根据上述代码,3的运算结果是()() A、 B、 C、 D、 11.关于有序列表的描述,下列说法正确的是()() A、有序列表没有排列顺序 B、有序列表按顺序排列,并不带有序号 C、有序列表按顺序排列并通过属性定义序号样式 D、有序列表不可以和无序列表嵌套使用 12.若要在网页中插入样式表,以下用法中正确的是()() A、; B、; C、; D、; 13.下列选项中,用于删除当前节点的子节点的方法是()() A、() B、() C、() D、() 14.以下属性中,不能增加盒子尺寸的属性是()。() A、 B、 C、 D、 15.网页程序设计中,运行下面的代码,则对话框中将显示()。< ""> 3 2 (2)(z);<>() A、2 B、2.5 C、5 D、16 得分 二、多选题(每题3分,共计15分)
网上客服培训考核 ---阶段二HTML标签和JavaScript脚本 试题类型:HTML标签和JavaScript脚本 考核类型:开卷
1. HTML(Hypertext Markup Language超文本标记语言)是一种用来制作超文本文 档的简单标记语言。利用各种标记(tags)来标识文档的结构以及标识超链(Hyperlink)的信息 2.HTML的标记总是封装在由 < 和 > 构成的一对尖括号之中。 除少数几个转义序列之外,HTML标记忽略大小写,即
关于JavaScript的学习总结 通过对《JavaScript DOM编程艺术》这本书的学习,总共学习到三大部分的内容:JavaScript1,JavaScript DOM和CSS样式表。CSS和JavaScript 都是通过控制页面标签的方式,来完善页面,使页面更美观,内容更丰富。 一、JavaScript部分 1.关于JavaScript js脚本语言 JavaScript一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,内置支持类型。它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用于客户端的脚本语言,最早是在HTML(标准通用标记语言下的一个应用)网页上使用,用来给HTML网页增加动态功能。 2.JS变量 2.1 JS的变量为易变量,没有类型的限制可以等于所有的类型。 2.2 JS变量的命名规则和java相同,且区分大小写。 JS的数据类型有7种:Number 数字类型、String 字符串类型、Boolean 布尔类型、Array 数组类型、Object 对象、Null 空对象、Undefined 未定义。 2.3 变量的声明,直接用var关键字声明即可:var a=90。也可以一次性声明多个变量:var b=1,c=2,d=3。如果一个变量没有声明就使
用,或是声明了没有设置值都是undefined。 3.数据类型的定义 数值类型: var age=33; 字符串类型: var mood=”happy” 布尔值类型: var add=true; 数组类型: var list= Array(2) list[0]=”jhon”; list[1]=33; 或者: var list=Array(“jhon”,33) (注:数组内可定义任意类型的数据,且数组下标从0 开始) NULL类型: var name=null ;或name=””; Undefined类型: var person; 对象类型: var jer= new person; 对象类型是一种非常重要的数据类型.对象是自我包含的数据集合,包含在对象里的数据可以通过两种方式--属性(property)和方法(method) 访问 例如: person.age Math.round() 4.JS操作符 算数操作符:加法(+),减法(-),乘法(*),除法(/) 如: var num=1+1; var num=num-1; var num=num*num; var num=num/2;
Javascript 114、alert怎样换行? \r\n 115、什么情况用HTML控件,什么情况用WEB控件,并比较两者差别 如果有数据提交到server端时用web control好。一般为了提高效率能用html control在客户端执行,就用html control。 116、JavaScript中的对象. JavaScript中的Object是一组数据的key-value的集合,有点类似于Java中的有这些数据都是Object里的property.通常情况下,JavaScript中建立一个对象用”new”加上constructor function来实现.如new Date(),new Object()等. var book=new Object(); https://www.wendangku.net/doc/704309375.html,="JavaScript is Cool"; book.author="tom"; book.pages=514; 上面例子中的name和page就是名为book的对象中的property.我们可以用delete 来删除Object中的property:“delete https://www.wendangku.net/doc/704309375.html,;”.除了Object,Date等buildin 的对象外,我们可以写自己的constructor function,然后使用new就可以建立自己的对象.如上面的book可以写成: function Book(name,author,page){ https://www.wendangku.net/doc/704309375.html,=name; this.author=author; this.page=page; } var abook=new Book("JavaScript is Cool","tom",514); 117、function的用法 在JavaScript中,function是一种数据类型,所有的function都是从buildin的Function object衍生的对象.所以在JavaScript中function可以作为参数传递,可以作为Object的property,也可以当作函数返回值.function在JavaScript中有两种用法,一种是当作constructor,前面加上new keyword用来建立对象.一种是当作method,为其他对象调用. 注意function和method在中文里的意思相当,在有些语言里也可以通用.但是在JavaScript中,它们还是有所区别的.function本身是是一个对象,而当作为一个方法他属于一个对象时,就成为了一个这个对象的method,相当于一个对象种的属性.也就是说method是相对于一个对象而言的,function在某些情况下成为了一个对象的method. function Book(name,author,page){ https://www.wendangku.net/doc/704309375.html,=name; this.author=author; this.page=page;
什么是DOM? 通过JavaScript,您可以重构整个HTML文档。您可以添加、移除、改变或重排页面上的项目。 要改变页面的某个东西,JavaScript就需要对HTML文档中所有元素进行访问的入口。这个入口,连同对HTML元素进行添加、移动、改变或移除的方法和属性,都是通过文档对象模型来获得的(DOM)。 在1998年,W3C发布了第一级的DOM规范。这个规范允许访问和操作HTML页面中的每一个单独的元素。 所有的浏览器都执行了这个标准,因此,DOM的兼容性问题也几乎难觅踪影了。 DOM可被JavaScript用来读取、改变HTML、XHTML以及XML文档。 DOM被分为不同的部分(核心、XML及HTML)和级别(DOM Level 1/2/3): Core DOM 定义了一套标准的针对任何结构化文档的对象 XML DOM 定义了一套标准的针对XML文档的对象 HTML DOM 定义了一套标准的针对HTML文档的对象。 HTML DOM 节点 HTML文档中的每个成分都是一个节点。 节点 根据DOM,HTML文档中的每个成分都是一个节点。 DOM是这样规定的: ?整个文档是一个文档节点 ?每个HTML标签是一个元素节点 ?包含在HTML元素中的文本是文本节点 ?每一个HTML属性是一个属性节点
注释属于注释节点 Node 层次 节点彼此都有等级关系。 HTML文档中的所有节点组成了一个文档树(或节点树)。HTML文档中的每个元素、属性、文本等都代表着树中的一个节点。树起始于文档节点,并由此继续伸出枝条,直到处于这棵树最低级别的所有文本节点为止。 文档树(节点数) 请看下面这个HTML文档:
js对Table操作大全