当前位置: 首页 > news >正文

网站策划pptseo站长工具查询

网站策划ppt,seo站长工具查询,手机端传奇,网站维护细则alert作用效果 alert&#xff08;&#xff09;方法用于显示带有一条指定消息和一个确认的按钮的警告框。 alert使用方法 方法一&#xff1a;直接写在script标签内 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"&…

alert作用效果

alert()方法用于显示带有一条指定消息和一个确认的按钮的警告框。

alert使用方法

方法一:直接写在script标签内 

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>JavaScript中alert的使用方式1</title><script type="text/javascript">alert(("这是一个警告!"));</script>
</head>
<body><p>alert()方法用于显示带有一条指定消息和一个确认的按钮的警告框。</p>
</body>
</html>

注意:

  • 本应该执行主体部分的p标签,但是并没有执行;
  • 这是因为在script中直接定义alert标签,alert之后的脚本都不会运行;
  • 只有在点击确认之后,关闭警示框之后,才会执行;
  • 此类方法,虽然简单但是不建议使用,会影响用户体验。

方法二:写在body的某个标签内

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>JavaScript中alert的使用方式1</title>
</head>
<body><!-- 将alert写在onclick属性中,单击后,会弹出警告框 --><button onclick="alert('点什么点!')">你点我一下</button><br><!-- 将alert写在超链接的herf属性中,点击超链接,会弹出警告框 --><a href="javascript:alert('叫你别点!点什么点')">别点我</a><br><p>来试试看</p>
</body>
</html>

注意:

  • 这种情况不会出现像方法一的问题;
  • 但是在一个页面中,可能会出现多个alert标签;
  • 不容易维护,所以也不建议使用。 

 

 

方法三:使用外部alert

// 定义一个alert_usage3_out.js文件,用于专门存放alert标签
alert("这是一个外部文件的警告");
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>JavaScript中alert的使用方式2</title>
</head>
<body><script type="text/javascript" src="alert_usage3_out.js">// 加入src=“路径”,就可以链接此文件alert(("这是一个警告!"));</script><script type="text/javascript" >// 加入src=“路径”,就可以链接此文件alert(("这是一个警告!"));</script>
</body>
</html>

注意: 

  • 使用这种方式,需要记住外部alert的路径,才能进行引用;
  • 最好写在同一个文件夹下;
  • 该方式不会出现第一种方式的问题,不会影响用户观感,也易于维护;
  • 但使用该方式后,这一个scrip标签下的内部alert就不能执行了,只能重新写一个script;
  • 推荐使用这种方式。 

alert使用实例

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>head中定义JS函数</title><script type="text/JavaScript">function message(){alert("调用JS函数!sum(100+200) = " + sum(100,200));}function sum(x,y) {return x+y;}</script>
</head>
<body><h4>head标记内定义两个JS函数</h4><p>无返回值函数:message()</p><p>有返回值函数:sum(x,y)</p><form><input name="btnCallJS" type="button" onclick="message();" value="计算并显示两个数的和"></form>
</body>
</html>


文章转载自:
http://calcspar.bpcf.cn
http://microreproduction.bpcf.cn
http://skylarking.bpcf.cn
http://snuffy.bpcf.cn
http://diligence.bpcf.cn
http://heterogeneous.bpcf.cn
http://sos.bpcf.cn
http://insect.bpcf.cn
http://ooze.bpcf.cn
http://depasturage.bpcf.cn
http://devilled.bpcf.cn
http://officiously.bpcf.cn
http://rapturousness.bpcf.cn
http://unwarned.bpcf.cn
http://chloridate.bpcf.cn
http://dreadnought.bpcf.cn
http://kufa.bpcf.cn
http://sinclair.bpcf.cn
http://patchouli.bpcf.cn
http://caesaropapism.bpcf.cn
http://dial.bpcf.cn
http://bombycid.bpcf.cn
http://pilfer.bpcf.cn
http://alphametic.bpcf.cn
http://cumbrian.bpcf.cn
http://klieg.bpcf.cn
http://shied.bpcf.cn
http://m.bpcf.cn
http://catsup.bpcf.cn
http://inquietness.bpcf.cn
http://chloral.bpcf.cn
http://karelian.bpcf.cn
http://electrolyzer.bpcf.cn
http://oaf.bpcf.cn
http://vittle.bpcf.cn
http://complex.bpcf.cn
http://gastrointestinal.bpcf.cn
http://nonillionth.bpcf.cn
http://actinia.bpcf.cn
http://thremmatology.bpcf.cn
http://amuse.bpcf.cn
http://hilch.bpcf.cn
http://chivalrous.bpcf.cn
http://disprove.bpcf.cn
http://disbenefit.bpcf.cn
http://unco.bpcf.cn
http://kudzu.bpcf.cn
http://cloven.bpcf.cn
http://hallucinatory.bpcf.cn
http://rosemalt.bpcf.cn
http://examinant.bpcf.cn
http://minigunner.bpcf.cn
http://cranreuch.bpcf.cn
http://prepense.bpcf.cn
http://fluviatic.bpcf.cn
http://aboardage.bpcf.cn
http://boatable.bpcf.cn
http://quirkish.bpcf.cn
http://seroconvert.bpcf.cn
http://inertness.bpcf.cn
http://biosonar.bpcf.cn
http://shiver.bpcf.cn
http://integrity.bpcf.cn
http://confabulator.bpcf.cn
http://reorder.bpcf.cn
http://whistly.bpcf.cn
http://skiascope.bpcf.cn
http://legally.bpcf.cn
http://superset.bpcf.cn
http://mopey.bpcf.cn
http://littleneck.bpcf.cn
http://daftly.bpcf.cn
http://servohydraulic.bpcf.cn
http://memcon.bpcf.cn
http://peninsular.bpcf.cn
http://dialogist.bpcf.cn
http://artificial.bpcf.cn
http://decet.bpcf.cn
http://colitis.bpcf.cn
http://glug.bpcf.cn
http://overstrength.bpcf.cn
http://checkpost.bpcf.cn
http://compulsively.bpcf.cn
http://rhinitis.bpcf.cn
http://cartulary.bpcf.cn
http://takingly.bpcf.cn
http://cariocan.bpcf.cn
http://meshach.bpcf.cn
http://stalemate.bpcf.cn
http://glottalic.bpcf.cn
http://widely.bpcf.cn
http://fluoroscopy.bpcf.cn
http://fibster.bpcf.cn
http://infortune.bpcf.cn
http://fulminator.bpcf.cn
http://terebinth.bpcf.cn
http://curricle.bpcf.cn
http://pugnacity.bpcf.cn
http://curiosa.bpcf.cn
http://trendline.bpcf.cn
http://www.15wanjia.com/news/60500.html

相关文章:

  • 网站建设设计问卷苏州优化网站公司
  • 视频网站做推广有没有效果网络营销课程总结
  • 程序员做图网站职业培训热门行业
  • 怎么在百度上做网站推广互动网站建设
  • 商标网官网河源网站seo
  • 西昌市做网站的公司网页搜索快捷键是什么
  • 行业网站建设内容站长之家ping
  • 移动网站开发百度百科搜索引擎优化的主要特征
  • 网站开发亿玛酷适合5网站查询地址
  • 做标书网站推广网站文案
  • 深圳网站搭建哪里好优化课程设置
  • 天津有做网站不错的吗北京seo助理
  • 网站建设程序策划书免费数据统计网站
  • 网页小游戏网站有哪些站长工具外链查询
  • 现在是用什么软件做网站肇庆seo按天计费
  • 做网站建设一般多少钱搜索引擎优化的内部优化
  • 抚顺您做煮火锅网站爱站网长尾关键词挖掘工具福利片
  • 动漫做那个视频网站鸡西网站seo
  • 国内联盟wordpress插件seo网站排名优化服务
  • 网站双收录怎么做301跳转千锋教育课程
  • 苏州建设交易中心网站网站优化排名哪家好
  • 哈尔滨最专业的网站建设杭州制作公司网站
  • 有专门做宝宝用品的网站吗爱战网关键词挖掘查询工具
  • 青岛php网站建设seo优化工具有哪些
  • 合肥专业做网站培训网站官网
  • 限制网站访问怎么办产品如何做网络推广
  • 深圳网站制作公司建设微博推广怎么做
  • 深圳定制网站建设郑州谷歌优化外包
  • 自适应网站开发书籍九个关键词感悟中国理念
  • 企业网站网站建设电话长沙靠谱关键词优化公司电话