meta

前端学习(446):函数重名的影响

你。 提交于 2020-01-20 19:59:14
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> function fn3(){ console.log("ccc"); } var fn3 = function(){ console.log("ddd"); } fn3(); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104041382

前端学习(447):函数重名的影响

冷暖自知 提交于 2020-01-20 16:53:51
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> var fn3=10; function fn3(){ console.log("ccc"); } fn3(); </script> </body> </html> 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104041519

前端学习(448):构造函数定义法和自执行函数

送分小仙女□ 提交于 2020-01-20 16:51:33
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> // 构造函数法 var fn4=new Function("a","console.log(a)"); fn4(10); // 自执行函数 执行一次之后就再也找不到了 称为自执行函数 (function(){ console.log("自执行函数"); })(); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104041769

前端学习(451):随机色

僤鯓⒐⒋嵵緔 提交于 2020-01-20 16:44:28
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>随机颜色</title> </head> <body> <script> function getRandomColor(){ // var r=(Math.random()*255).toFixed(0); var r=parseInt(Math.random()*256).toString(); var g=parseInt(Math.random()*256).toString(); var b=parseInt(Math.random()*256).toString(); console.log("rgba("+r+","+g+","+b+","+Math.random().toFixed(2)+")"); } getRandomColor(); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn

前端学习(452):随机色二

谁都会走 提交于 2020-01-20 16:40:45
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> function getRandomColor(){ var color="#"; for(var i=0;i<3;i++){ var str=parseInt(Math.random()*256); if(str<16){ str="0"+str.toString(16); }else{ str=str.toString(16); } color+=str; } console.log(color); } getRandomColor(); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104043483

前端学习(455):return

蹲街弑〆低调 提交于 2020-01-20 13:38:27
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> // return 可以返回一个数据给函数运行的外面 function sum(a,b){ return a+b; } console.log(sum(10,20)); function fn1(a,b){ var sum=a+b; console.log("sum"+sum); } console.log(fn1(3,5)); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104049465

promise的异步 同步 用法

橙三吉。 提交于 2020-01-20 04:22:18
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> p { position: absolute; } </style> </head> <body> <input type="file" onchange="changepic(this)"></div> <img src="" alt="" id="img"> <!-- <p>213123123</p> --> <script src="js/lib/jquery-1.11.1.min.js"></script> <script> function changepic(event) { var reader = new FileReader(); var file = event.files[0]; if (file) { var fileSize = file.size / (1024 * 1024); // 限制文件大小 if

鼠标经过图片放大

北城以北 提交于 2020-01-20 02:01:30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <style> .div_img{ width: 300px; height: 300px; border: #000 solid 1px; margin: 50px auto; overflow: hidden; text-align: center; } .div_img img{ cursor: pointer; transition: all 1.5s; } .div_img

前端学习(439):参数4

拈花ヽ惹草 提交于 2020-01-20 01:32:55
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> function fn3(s){ s+=10; } var sum=10; fn3(sum); console.log(sum); </script> </body> </html> 运行结果 来源: CSDN 作者: 你知道歌谣吗? 链接: https://blog.csdn.net/weixin_43392489/article/details/104039145

2019 SDN上机第7次作业

瘦欲@ 提交于 2020-01-19 20:38:04
1.补充并运行basic代码 根据 P4教程 ,将 basic 和 basic_tunnel 两个案例程序补充完整,成功运行。 补充Basic代码: /* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bit<4> ihl;