jQuery - 综合实例 - 生成在两个边界间的随机数

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

   jQuery - 综合实例 - 生成在两个边界间的随机数

   [实例]

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html>
       <head>
           <title>生成在两个边界间的随机数</title>
           <script type="text/javascript" src="jquery-1.2.js"></script>
           <script type="text/javascript">
               function boundrandom(bound1, bound2) {
                   var bound1 = parseFloat(bound1);
                   var bound2 = parseFloat(bound2);
                   return Math.random() * (bound1 - bound2) + bound2;
               }
               $(document).ready(function () {
                   $("#generate").click(function () {
                       $("#output").html("");
                       for(var i = 0; i < 100; i++) {
                        $("#output").append("<div>" + boundrandom($("#bound1").val(), $("#bound2").val()) + "<//div>");
                       }
                   });
               });
           </script>
       </head>
       <body>
           <div>
               边界:<input type="text" id="bound1" />
           </div>
           <div>
               边界:<input type="text" id="bound2" />
           </div>
           <div>
               <input id="generate" type="button" value="生成在两个边界间的随机数" />
           </div>
           <div id="output"></div>
       </body>
   </html>

   [jQuery - 官方网站]

http://jquery.com/

   [jQuery - 当前版本]

http://docs.jquery.com/Release:jQuery_1.2

   [jQuery - 其他下载地址]

下载列表, http://docs.jquery.com/Downloading_jQuery
最新代码, http://code.jquery.com/nightlies/jquery-nightly.js

   [jQuery - 相关论坛]

http://groups.google.com/group/jquery-en
http://WebDev.board.newsmth.net/
http://WebGeeks.board.newsmth.net/
http://bbs.pku.edu.cn/, homepage看版
http://forum.csdn.net/SList/JavaScript/

   [jQuery - 关键词]

jQuery

   [jQuery - Core核心]

each迭代, http://docs.jquery.com/Core/each

   [jQuery - Ajax]

 jQuery的Ajax文档, http://docs.jquery.com/Ajax/jQuery.ajax
jQuery的Ajax选项,http://docs.jquery.com/Ajax/jQuery.ajax#options
dataType选项,设置返回值类型
timeout选项,用于设置超时
与PHP集成可以使用json_encode返回结果, http://www.php.net/manual/zh/function.json-encode.php

   [jQuery - 特效]

   jQuery淡入特效,http://docs.jquery.com/Effects/fadeIn

   [jQuery - Selectors选择器]

表单元素选择器, http://docs.jquery.com/DOM/Traversing/Selectors#Form_Selectors
属性相等选择器,http://docs.jquery.com/Selectors/attributeEquals
checked选中, http://docs.jquery.com/Selectors/checked
选择器在选择body中出现的title标记时,会出现和预期不同的效果。

   [jQuery - 常用函数]

   attr访问自定义属性,减少javascript脚本中代码和数据的耦合
click, 绑定元素的onclick事件,http://docs.jquery.com/Events/click
filter, 用于在集合中过滤元素

   [jQuery - Events事件]

hover, http://docs.jquery.com/Events/hover
submit提交, http://docs.jquery.com/Events/submit

   [jQuery - Traversing遍历器]

filter过滤, http://docs.jquery.com/Traversing/filter
find查找, http://docs.jquery.com/Traversing/find

   [jQuery - Tutorials教程]

Introducing $(document).ready(), http://docs.jquery.com/Tutorials:Introducing_%24%28document%29.ready%28%29

   [jQuery - plugins插件]

Easing动画, http://jquery.com/plugins/project/easing
jCarouseLite, 走马灯效果, http://jquery.com/plugins/project/jCarouselLite
tableFilter, 表过滤器, http://jquery.com/plugins/project/tableFilter
Rounded Corner圆角矩形, http://docs.jquery.com/Tutorials:Rounded_Corners#Rounded_Corners_Without_Images

   [jQuery - Utilities实用工具]

trim去掉字符串前后的空格, http://docs.jquery.com/Utilities/jQuery.trim

   [jQuery - 重要工具]

http://www.json.org/, http://www.json.org/json.js

   [jQuery - 综合实例]

   实现前一个和后一个效果

   跨窗口调用函数

   定时刷新

   下拉列表框打开指定网站

生成在两个边界间的随机数

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
这里写图片描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值