网页javascript精华代码集

PHP服务端 苹果支付(IAP)处理 公司做的app需要做IAP订阅支付,开始觉得和微信的支付流程差不多,做起来还是有点麻烦,主要是网上的文章很少,不能拿来主义。自己做完总结一下,希望对小伙伴们有帮助我就很欣慰了。代码写的不好 不要喷我。。。 首先讲一下我的业务逻辑,也就是php服务端需要做什么事情。 先上图: 下面我详细的讲一下每... 阅读详情
网页javascript精华代码集
 
【1、普通的弹出窗口】
<SCRIPT LANGUAGE=javascript>
<!--
window.open ('page.html')
-->
</SCRIPT>
  <!-- 和 -->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示
出来。用单引号和双引号都可以,只是不要混用。
【2、经过设置后的弹出窗口】
<SCRIPT LANGUAGE=javascript>
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no,
menubar=no, scrollbars=no, resizable=no,location=no, status=no')
//写成一行
-->
</SCRIPT>
  参数解释:
<SCRIPT LANGUAGE=javascript> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字,非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</SCRIPT> js脚本结束
【3、用函数控制弹出窗口】
  下面是一个完整的代码。
<html>
<head>
<script LANGUAGE=javascript>
<!--
function openwin() {
window.open (page.html, newwindow, height=100, width=400, toolbar=no, menubar=no,
scrollbars=no, resizable=no, location=no, status=no)
//写成一行
}
//-->
</script>
</head>
<body onload=openwin()>
.....
</body>
</html>
  这里定义了一个函数openwin(),怎么调用呢?
  方法一:<body onload=openwin()> 浏览器读页面时弹出窗口;
  方法二:<body onunload=openwin()> 浏览器离开页面时弹出窗口;
  方法三:用链接调用:        方法四:用按钮调用:

【4、同时弹出2个窗口】
  对源代码稍微改动一下:
<script LANGUAGE=javascript>
<!--
function openwin() {
window.open (page.html, newwindow, height=100, width=100, top=0, left=0,toolbar=no,
menubar=no, scrollbars=no, resizable=no, location=no, status=no)
//写成一行
window.open (page2.html, newwindow2, height=100, width=100, top=100, left=100,toolbar=no,
menubar=no, scrollbars=no, resizable=no, location=no, status=no)
//写成一行
}
//-->
</script>

  为避免弹出的2个窗口覆盖,用top和left控制一下弹出的位置不要相互覆盖即可。最后用上面说过
的四种方法调用即可。
注意:2个窗口的name(newwindows和newwindow2)不要相同,或者干脆全部为空。
  【5、主窗口打开文件1.htm,同时弹出小窗口page.html】
  如下代码加入主窗口<head>区:
<script language=javascript>
<!--
function openwin() {
window.open(page.html,,width=200,height=200)
}
//-->
</script>
加入<body>区:
<a href=1.htm onclick=openwin()>open</a>即可。
  【6、弹出的窗口之定时关闭控制】
  下面我们再对弹出的窗口进行一些控制,效果就更好了。如果我们再将一小段代码加入弹出的页面(
注意是加入到page.html的HTML中,可不是主页面中,否则...),让它10秒后自动关闭是不是更酷了?
  首先,将如下代码加入page.html文件的<head>区:
<script language=javascript>
function closeit() {
setTimeout(self.close(),10000) //毫秒
}
</script>
  然后,再用<body onload=closeit()> 这一句话代替page.html中原有的<BODY>这一句就可以了。(这
一句话千万不要忘记写啊!这一句的作用是调用关闭窗口的代码,10秒钟后就自行关闭该窗口。)
  【7、在弹出窗口中加上一个关闭按钮】
<FORM>
<INPUT TYPE='BUTTON' value='关闭' onClick='window.close()'>
</FORM>
  【8、内包含的弹出窗口-一个页面两个窗口】
通过下面的例子,你可以在一个页面内完成上面的效果。
<html>
<head>
<SCRIPT LANGUAGE=javascript>
function openwin()
{
OpenWindow=window.open(, newwin, height=250,
width=250,toolbar=no,scrollbars=+scroll+,menubar=no);
//写成一行
OpenWindow.document.write(<TITLE>例子</TITLE>)
OpenWindow.document.write(<BODY BGCOLOR=OpenWindow.document.write(<h1>Hello!</h1>)
OpenWindow.document.write(New window opened!)
OpenWindow.document.write(</BODY>)
OpenWindow.document.write(</HTML>)
OpenWindow.document.close()
}
</SCRIPT>
</head>
<body>
<a href=<input type=button onclick=openwin() value=打开窗口>
</body>
</html>
  看看 OpenWindow.document.write()里面的代码不就是标准的HTML吗?只要按照格式写更多的行即
可。千万注意多一个标签或少一个标签就会出现错误。记得用OpenWindow.document.close()结束啊。

【9、弹出的窗口之Cookie控制】
  回想一下,上面的弹出窗口虽然酷,但是有一点小毛病。比如你将上面的脚本放在一个需要频繁经
过的页面里(例如首页),那么每次刷新这个页面,窗口都会弹出一次,是不是非常烦人?:-(
  解决办法:
  我们使用cookie来控制一下就可以了。首先,将如下代码加入主页面HTML的<HEAD>区:
<script>
function openwin(){
window.open(page.html,,width=200,height=200)
}
function get_cookie(Name) {
var search = Name + =
var returnvalue = ;
if (documents.cookie.length > 0) {
offset = documents.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = documents.cookie.indexOf(;, offset);
if (end == -1)
end = documents.cookie.length;
returnvalue=unescape(documents.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadpopup(){
if (get_cookie('popped')==''){
openwin()
documents.cookie=popped=yes
}
}
</script>
  然后,用<body onload=loadpopup()>(注意不是openwin而是loadpop啊!)替换主页面中原有的
<BODY>这一句即可。你可以试着刷新一下这个页面或重新进入该页面,窗口再也不会弹出了。真正的
Pop-Only-Once!
  写到这里弹出窗口的制作和应用技巧基本上算是完成了。

  1.弹启一个全屏窗口
<html>
<body onload=window.open('http://www.pconline.com.cn','example01','fullscreen');>;
<b> www.e3i5.com</b>
</body>
</html>
  2.弹启一个被F11化后的窗口
<html>
<body onload=window.open(''http://www.pconline.com.cn','example02','channelmode');>;
<b> www.e3i5.com</b>
</body>
</html>
  3.弹启一个带有收藏链接工具栏的窗口
<html>
<body onload=window.open
('http://www.pconline.com.cn','example03','width=400,height=300,directories');>
<b> www.e3i5.com</b>
</body>
</html>
  4.网页对话框
<html>
<SCRIPT LANGUAGE=javascript>
<!--
showModalDialog
('http://www.pconline.com.cn','example04','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b> www.e3i5.com</b>
</body>
</html>
<html>
<SCRIPT LANGUAGE=javascript>
<!--
showModelessDialog
('http://www.pconline.com.cn','example05','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b> target=_blank> http://www.pconline.com.cn</b>
</body>
</html>
  showModalDialog()与showModelessDialog()的区别,在于showModalDialog()打开模式窗口,
showModelessDialog()打开无模式窗口。
dialogHeight: iHeight 设置对话框窗口的高度。
dialogWidth: iWidth 设置对话框窗口的宽度。   
dialogLeft: iXPos 设置对话框窗口相对于桌面左上角的left位置。
dialogTop: iYPos 设置对话框窗口相对于桌面左上角的top位置。
center: {yes no 1 0 } 指定是否将对话框在桌面上居中,默认值是“yes”。
help: {yes no 1 0 } 指定对话框窗口中是否显示上下文敏感的帮助图标。默认值是“yes”。   
resizable: {yes no 1 0 } 指定是否对话框窗口大小可变。默认值是“no”。
status: {yes no 1 0 } 指定对话框窗口是否显示状态栏。对于非模式对话框窗口,默认值是“yes”;
对于模式对话框窗口,默认值是 “no”。

网页经典代码
1. 将彻底屏蔽鼠标右键,无右键菜单
<body oncontextmenu=window.event.returnvalue=false>
也可以用于网页中Table框架中
<table border oncontextmenu=return(false)><td>no</table>

2.取消选取、防止复制
<body onselectstart=return false>

3.不准粘贴
<body onpaste=return false>

4.防止复制
<body oncopy=return false; oncut=return false;>

5.IE地址栏前换成自己的图标
<link rel=Shortcut Icon href=favicon.ico>
说明:关于favicon.ico文件的制作。你可以先在FW中做一个图片,属于你自己站点一个小图标。然后在
ACD see将文件属性改为*.ico,然后将你做的*.ICO文件传到你的服务器目录中,然后就可以使用以上代
码来实现,当别人登陆你的站点时,地址栏里使用的就是你自定义的图标了。

6.可以在收藏夹中显示出你的图标
<link rel=Bookmark href=favicon.ico>
说明:制作方法和上面的一样。只是显示的方式不同,这个是在别人收藏你的网页地址时显示的个性图
标。

7.关闭输入法
<input style=ime-mode:disabled>
说明:这段代码是在表格提交时用到的。也就是在输入数据时不可以使用其他输入法模式。

8.永远都会带着框架
<script language=javascript><!--
  if (window == top)top.location.href = frames.htm;// --></script>
说明:frames.htm为你的网页,这也是保护页面的一种方法

9.防止被人frame
<SCRIPT LANGUAGE=javascript><!--
  if (top.location != self.location)top.location=self.location;
// --></SCRIPT>

10.网页将不能被另存为
<noscript><iframe src=*.html></iframe></noscript>
说明:<noscirpt>的用法很广,其中一条就是可以使JS广告失效。

11.查源文件
<input type=button value=查看网页源代码
onclick=window.location = 'view-source:'+ target=_blank> http://bbs.055.cn/test.htm';>

12.COOKIE脚本记录,有很大的用处哦
function get_cookie(Name) {
var search = Name + =
var returnvalue = ;
if (documents.cookie.length > 0) {
offset = documents.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = documents.cookie.indexOf(;, offset);
// set index of end of cookie value
if (end == -1)
end = documents.cookie.length;
returnvalue=unescape(documents.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadpopup(){
if (get_cookie('popped')==''){
openpopup()
documents.cookie=popped=yes
}
}
说明:以上是JS代码,请自己加起始符和结束符

13.内框架<IFRAME>使用
Iframe标记的使用格式是:   
<iframe src=URL width=x height=x scrolling=[OPTION] frameborder=x
name=main></iframe>
src:文件的路径,既可是HTML文件,也可以是文本、ASP等  
width、height:内部框架区域的宽与高;   
scrolling:当SRC的指定的HTML文件在指定的区域不显不完时,滚动选项,如果设置为NO,则不出现滚动
条;如为Auto:则自动出现滚动条;如为Yes,则显示;  FrameBorder:区域边框的宽度,为了让“内
部框架“与邻近的内容相融合,常设置为0。
name:框架的名字,用来进行识别。
比如:  当你想用父框架控制内部框架时,可以使用: target=框架的名字来控制。
例子:<iframe name=mm src=http://bbs.055.cn;; width=100% height=100% marginwidth=0
marginheight= ... ot; frameborder=0 scrolling=no></iframe>
14.自动跳转
在源代码中的<head>…</head>加入如下代码:
<meta http-equiv=refreshcontent=3;URL=http://bbs.055.cn; charset=gb2312>
说明:content=3 表示3秒刷新到URL

15.如何改变链接的鼠标形状
只需在链接上加上这一代码就行的了
或者跟上面的用CSS写也行
style=cursor:hand       style=cursor:crosshair
style=cursor:text       style=cursor:wait
style=cursor:move       style=cursor:help
style=cursor:e-resize     
style=cursor:n-resize
style=cursor:nw-resize     style=cursor:w-resize
style=cursor:s-resize     
style=cursor:se-resize
style=cursor:sw-resize
以上代码你只需要加到连接或是页面的style区里就可以实现鼠标多样化。

16.全屏显示
<form>
<div align=center>
<input type=BUTTON name=FullScreen value=全屏显示 onClick=window.open(document.location,
'big', 'fullscreen=yes')>
</div>
</form>
把它放到<body>中。

17.设为首页
<script language=javascript>
<!--
function defaul_home(){
this.home.style.behavior='url(#default#homepage)';this.home.setHomePage([url]
[url=http://bbs.055.cn/[/url]] http://bbs.055.cn/[/url]'[/url];
}
var focusok=false;
if (navigator.appName == Netscape{
focusok=true;
}
vers=navigator.appVersion;
if (navigator.appName == Microsoft Internet Explorer{
pos=vers.lastIndexOf('.');
vers=vers.substring(pos-1,vers.length);
}
proper_version=parseFloat(vers);
if(proper_version>=5){
focusok=true;
}
function launchstock1(htmlurl){
var stock=window.open
(htmlurl,stock,top=2,left=2,toolbar=no,location=no,directories=no,status=no,menubar=no,scro
llbars=yes,
resizable=no,width=700,height=510;
if(focusok){
stock.focus();
}
return true;
}
function launchstock(){
var stock=window.open
(,stock,top=2,left=2,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=
yes,
resizable=no,width=700,height=510;
if(focusok){
stock.focus();
}
return true;
}
// -->
</script>
<a href=# name=home onClick=defaul_home(); title===E代时光==>设为首页</a>

18.这里是加入收藏夹的代码
<a href=# onClick=window.external.addFavorite( http://bbs.055.cn';.'拂晓雅阁')
target=_self title=拂晓雅阁>加入收藏夹</a>

19.flash图片效果
以下代码加入<head>区域
<SCRIPT language=javascript>
<!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=20
}
//-->
</SCRIPT>
以下代码加入<body>区域
<img src=http://bbs.055.cn/images/logo.gif;; style=filte ... nbsp;onMouseOver=makevisible
(this,0) onMouseOut=makevisible(this,1) width=63 height=56> //图片地址请自己改

20.load 进度条
<table cellspacing=0 cellpadding=0 bgcolor=#FFFFFF width=40% id=P><tr><td>
<table cellspacing=0 cellpadding=0 bgcolor=#0000FF height=18
id=Q><tr><td></td></tr></table></td></tr></table>
</center>
<script language=javascript>
var R = 0; load();
function load() {R = R + 2; Q.style.width = R + %; time= setTimeout(load(),50);
if (R > 100) {clearTimeout(time); P.style.width=0}}
</script>
27 全屏
<script language=javascript>
window.open('index.asp','','fullscreen=1');
</script>

21.背景图片滚动
<body scroll=no background=images/bg.jpg link=#00FF00 alink=#FF0000 vlink=#00FF00
bgcolor=#000080 topmargin=8>
<script language=javascript>
var backgroundOffset = 0;
var bgObject = eval('document.body');
function scrollBG(maxSize) {backgroundOffset = backgroundOffset + 1;
if (backgroundOffset > maxSize) backgroundOffset = 0;
bgObject.style.backgroundPosition = 0  + backgroundOffset;}
var ScrollTimer = window.setInterval(scrollBG(410), 20)
</script>

22.网页不会被缓存
HTMl网页
<META HTTP-EQUIV=pragma CONTENT=no-cache>
<META HTTP-EQUIV=Cache-Control CONTENT=no-cache, must-revalidate>
<META HTTP-EQUIV=expires CONTENT=Wed, 26 Feb 1997 08:21:57 GMT>
或者<META HTTP-EQUIV=expires CONTENT=0>
ASP网页
  Response.Expires = -1
  Response.ExpiresAbsolute = Now() - 1
  Response.cachecontrol = no-cache
PHP网页
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT;
header(Cache-Control: no-cache, must-revalidate;
header(Pragma: no-cache;
23.最小化、最大化、关闭窗口
<object id=hh1 classid=clsidDB880A6-D8FF-11CF-9377-00AA003B7A11>
<param name=Command value=Minimize></object>
<object id=hh2 classid=clsidDB880A6-D8FF-11CF-9377-00AA003B7A11>
<param name=Command value=Maximize></object>
<OBJECT id=hh3 classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11>
< ARAM NAME=Command value=Close></OBJECT>
<input type=button value=最小化 onclick=hh1.Click()>
<input type=button value=最大化 onclick=hh2.Click()>
<input type=button value=关闭 onclick=hh3.Click()>
24.判断上一页的来源
asp页:
request.servervariables(HTTP_REFERER
java script:
document.referrer

25.光标是停在文本框文字的最后
<script language=javascript>
function cc()
{
  var e = event.srcElement;
  var r =e.createTextRange();
  r.moveStart('character',e.value.length);
  r.collapse(true);
  r.select();
}
</script>
<input type=text name=text1 value=123 onfocus=cc()>

JavaScript几个表单常用的验证脚本:
    只能输入数字
<input
      >
 

    ENTER键可以让光标移到下一个输入框
<input  > <br>
    只能是中文
<input  > <br>
    屏蔽输入法
<input style="ime-mode:disabled" > <br>
    只能输入英文和数字
<input
     
      > <br>

    只能显示,不能修改
<input readonly value="只能显示,不能修改">

    禁止复制选择等................
<script language="JavaScript" type="text/JavaScript">
    双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
 
CLRNet车道线检测模型在Orin Nano Super开发板上的全栈部署与优化实践 本文详细介绍了将CLRNet车道线检测模型部署到NVIDIA Orin Nano Super开发板的全过程。内容包括:1) Orin开发板硬件规格分析;2) JetPack SDK环境配置与Python虚拟环境搭建;3) CLRNet模型架构解析与PyTorch实现;4) 模型转换与TensorRT加速优化方法。通过系统性的环境配置、模型转换和性能优化,为边缘计算场景下的车道线检测应用提供了完整的解决方案,实现了在Orin平台上的高效部署。 阅读详情

相关推荐

环境配置 |Jupyter lab/Jupyter Notebook 安装与设置

ipynb使用Jupyterlab/Jupyter Notebook 来编写程序时的文件,在使用时,可以现转换为标准的.py的python文件。

weixin_44649780的博客 5772

大二学生web期末大作业 在线电影网站 HTML+CSS+JS

📔网站布局方面:计划采用目前主流的、能兼容各大主流浏览器、显示效果稳定的浮动网页布局结构。📓网站程序方面:计划采用最新的网页编程语言HTML5+CSS3+JS程序语言完成网站的功能设计。并确保网站代码兼容目前市面上所有的主流浏览器,已达到打开后就能即时看到网站的效果。📘网站素材方面:计划收集各大平台好看的图片素材,并精挑细选适合网页风格的图片,然后使用PS做出适合网页尺寸的图片。📒网站文件方面:网站系统文件种类包含:html网页结构文件、css网页样式文件、js网页特效文件、images网页图片文件

HTML网页设计 专注大学生网页设计 7万+

告别UI字体臃肿!详解TextMeshPro字体AssetBundle打包优化技巧(Unity 2022实测)

本文详细解析了Unity 2022中使用TextMeshPro时字体资源AssetBundle打包的优化技巧,特别针对中日文等多语言场景下的字体臃肿问题。通过公共资源标记、依赖关系分析和实战案例,帮助开发者有效减少包体体积和内存占用,提升游戏性能。

weixin_33725722的博客 419

常用的JS代码

JS代码收藏大全- -                                        1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键 no 可用于Table2. 取消选取、防止复制3. onpaste="return false" 不准粘贴4. oncopy="return false;" o

Microblue(严 武) 1116

[官方培训]22-UE资产优化 Epic 肖月 笔记

Nanite+Lumen目标:面向TA,美术,不影响视觉的前提下,优化运行和编辑效率引擎:UE5.1延迟管线平台:主流PC,Windows 10 with DX12。

Tcohneyn的博客 1575

D类功放LC滤波器实战:从Q值0.707到EMI优化的完整设计流程

本文详细解析了D类功放LC滤波器的完整设计流程,从确定截止频率与Q值0.707的理论基础出发,到参数计算、仿真验证及关键元器件选型,并提供了应对EMI超标和过流保护等实际问题的进阶调试策略。文章强调,精准的LC滤波器设计是平衡音质、稳定性与电磁兼容性的关键,尤其需关注电感饱和电流与电容直流偏置等细节。

e4f5g6h7的博客 1036

36个精美完整网站网页完整源码HTML+CSS+JS网页课程设计

以下列举前9个效果图,源码详见文末,可以自定义修改①效果图 ②效果图 ③效果图 ④效果图 ⑤效果图 ⑥效果图 ⑦效果图 ⑧效果图 ⑨效果图

叶绿体不忘呼吸 5万+

STM32F407+LAN8720A+LwIP实战:FreeModbus TCP从机功能开发指南

本文详细介绍了基于STM32F407和LAN8720A硬件平台,结合LwIP协议栈实现FreeModbus TCP从机功能的开发指南。内容涵盖硬件连接、LwIP移植、FreeModbus TCP从机实现、任务调度及调试技巧,为工业控制领域的以太网通信开发提供实用参考。

weixin_29190651的博客 546

73种网页常用js代码

1、后退前进 &lt;input type="button" value="后退" onClick="history.go(-1)"&gt; &lt;input type="button" value="前进" onClick="history.go( 1 );return true;"&gt;     2、返回 &lt;form&amp

一路向前的博客 3654

MIPI转LVDS芯片调试实战:从Kernel到UEFI的完整点亮流程

本文详细解析了MIPI转LVDS芯片调试的全流程,从Kernel驱动开发到UEFI早期初始化,涵盖I2C通信、电源时序控制等核心挑战。通过LT9211芯片实战案例,提供设备树配置、电源时序优化及显示异常排查等实用技巧,助力工程师高效完成屏幕调试工作。

weixin_30314813的博客 450

SAP_MM模块库存概览俄罗斯报表简介

本文介绍了SAP MM模块中"库存概览俄罗斯报表"的功能与应用。该报表主要用于查看物料在不同库存地点和类型的库存情况,并满足俄罗斯当地法规要求。文章解释了"俄罗斯报表"可能指代本地化合规库存报表或客户自定义报表,详细说明了事务代码J3RFLVMOBVEDH的操作步骤,包括公司代码、物料编码、日期范围等查询条件,并解释了报表中各字段含义如期初期末库存数量与价值。最后强调在物料分类账处理完成后使用该报表可获得实际库存价值,为SAP用户提供了实用的库存管理参考。

我小时候很黑的博客 1088

大学生网页设计制作作业实例代码 (全网最全,建议收藏) HTML+CSS+JS

临近期末,大一新生的各种考试和专业结课作业纷至沓来。web实训大作业、网页期末作业、web课程与设计、网页设计等,简直让人头大。你还在为网页设计老师的作业要求感到头大?网页作业无从下手?网页要求的总数量太多?没有合适的模板?等等一系列问题。你想要解决的问题,在这篇博文中基本都能满足你的需求, 废话不多说,直接看效果。📔网站布局方面:计划采用目前主流的、能兼容各大主流浏览器、显示效果稳定的浮动网页布局结构。📓网站程序方面:计划采用最新的网页编程语言HTML5+CSS3+JS程序语言完成网站的功能设计。并确

HTML网页设计 27万+

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

javascript网页精华代码集

 【1、普通的弹出窗口】 window.open (page.html) -->   是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示 出来。用单引号和双引号都可以,只是不要混用。 【2、经过设置后的弹出窗口】 window.open (page.html, newwindow, height=100, width=400, top=0,

魔拉宝 1181

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

网页js精华代码集

【1、普通的弹出窗口】其实代码非常简单: <!-- window.open (page.html) -->   因为这是一段javascripts代码,所以它们应该放在标签和之间。和 -->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示出来。要养成这个好习惯啊。 window.open (page.html) 用于控制弹出新的窗口p

Bingo_Me的天空 557

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

上一篇: 鼠标拖动层的JS方法
下一篇: 任务栏不能显示声音图标(电脑运行有声音)
qq_13854514
博客等级 码龄20年 29粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值