0

0

针对HTML5的Web Worker使用攻略_html5教程技巧

php中文网

php中文网

发布时间:2016-05-16 15:46:23

|

1586人浏览过

|

来源于php中文网

原创

web workers 是 html5 提供的一个javascript多线程解决方案,我们可以将一些大计算量的代码交由web worker运行而不冻结用户界面。
一:如何使用worker

  Web Worker的基本原理就是在当前javascript的主线程中,使用Worker类加载一个javascript文件来开辟一个新的线程,起到互不阻塞执行的效果,并且提供主线程和新线程之间数据交换的接口:postMessage,onmessage。

  那么如何使用呢,我们看一个例子:
 

JavaScript Code复制内容到剪贴板
  1. //worker.js   
  2. onmessage =function (evt){   
  3.   var d = evt.data;//通过evt.data获得发送来的数据   
  4.   postMessage( d );//将获取到的数据发送会主线程   
  5. }  

  HTML页面:test.html

 

立即学习前端免费学习笔记(深入)”;

XML/HTML Code复制内容到剪贴板
  1. nbsp;HTML>  
  2. html>  
  3. span style="width: auto; height: auto; float: none;" id="20_nwp">a style="text-decoration: none;" mpid="20" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=head&k0=head&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="20_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">headspan>a>span>>  
  4.  meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
  5.  script type="text/span style="width: auto; height: auto; float: none;" id="21_nwp">a style="text-decoration: none;" mpid="21" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=javascript&k0=javascript&kdi0=0&luki=9&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="21_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">javascriptspan>a>span>">  
  6. //WEB页主线程   
  7. var worker =new Worker("worker.js"); //创建一个Worker对象并向它传递将在新线程中执行的脚本的URL   
  8.  worker.postMessage("hello world");     //向worker发送数据   
  9.  worker.onmessage =function(evt){     //接收worker传过来的数据span style="width: auto; height: auto; float: none;" id="22_nwp">a style="text-decoration: none;" mpid="22" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=%BA%AF%CA%FD&k0=%BA%AF%CA%FD&kdi0=0&luki=2&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="22_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">函数span>a>span>  
  10.    console.log(evt.span style="width: auto; height: auto; float: none;" id="23_nwp">a style="text-decoration: none;" mpid="23" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=data&k0=data&kdi0=0&luki=4&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="23_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">dataspan>a>span>);              //输出worker发送来的数据   
  11.  }   
  12.  script>  
  13.  head>  
  14.  body>body>  
  15. html>  

  用Chrome浏览器打开test.html后,控制台输出 ”hello world” 表示程序执行成功。

  通过这个例子我们可以看出使用web worker主要分为以下几部分

  WEB主线程:

  1.通过 worker = new Worker( url ) 加载一个JS文件来创建一个worker,同时返回一个worker实例。

  2.通过worker.postMessage( data ) 方法来向worker发送数据。

  3.绑定worker.onmessage方法来接收worker发送过来的数据。

  4.可以使用 worker.terminate() 来终止一个worker的执行。

  worker新线程:

  1.通过postMessage( data ) 方法来向主线程发送数据。

  2.绑定onmessage方法来接收主线程发送过来的数据。
  二:Worker能做什么

  知道了如何使用web worker ,那么它到底有什么用,可以帮我们解决那些问题呢。我们来看一个fibonacci数列的例子。

  大家知道在数学上,fibonacci数列被以递归的方法定义:F0=0,F1=1,Fn=F(n-1)+F(n-2)(n>=2,n∈N*),而javascript的常用实现为:

JavaScript Code复制内容到剪贴板
  1.     
  2. var fibonacci =function(n) {   
  3.     return n 
  4. };   
  5. //fibonacci(36)  

  在chrome中用该方法进行39的fibonacci数列执行时间为19097毫秒 ,而要计算40的时候浏览器直接提示脚本忙了。

  由于javascript是单线程执行的,在求数列的过程中浏览器不能执行其它javascript脚本,UI渲染线程也会被挂起,从而导致浏览器进入僵死状态。使用web worker将数列的计算过程放入一个新线程里去执行将避免这种情况的出现。具体看例子:
 

  HTML页面:fibonacci.html
 

XML/HTML Code复制内容到剪贴板
  1. nbsp;HTML>  
  2. html>  
  3. span style="width: auto; height: auto; float: none;" id="11_nwp">a style="text-decoration: none;" mpid="11" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=head&k0=head&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="11_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">headspan>a>span>>  
  4. meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
  5. title>web worker fibonaccititle>  
  6. script type="text/span style="width: auto; height: auto; float: none;" id="12_nwp">a style="text-decoration: none;" mpid="12" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=javascript&k0=javascript&kdi0=0&luki=9&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="12_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">javascriptspan>a>span>">  
  7.   onload =function(){   
  8.       var worker =new Worker('fibonacci.js');     
  9.       worker.addEventListener('message', function(event) {   
  10.         var timer2 = (new Date()).valueOf();   
  11.            console.log( '结果:'+event.span style="width: auto; height: auto; float: none;" id="13_nwp">a style="text-decoration: none;" mpid="13" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=data&k0=data&kdi0=0&luki=4&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="13_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">dataspan>a>span>, '时间:'+ timer2, '用时:'+ ( timer2  - timer ) );   
  12.       }, false);   
  13.       var timer = (new Date()).valueOf();   
  14.       console.log('开始计算:40','时间:'+ timer );   
  15.       setTimeout(function(){   
  16.           console.log('定时器span style="width: auto; height: auto; float: none;" id="14_nwp">a style="text-decoration: none;" mpid="14" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=%BA%AF%CA%FD&k0=%BA%AF%CA%FD&kdi0=0&luki=2&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="14_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">函数span>a>span>在计算数列时执行了', '时间:'+ (new Date()).valueOf() );   
  17.       },1000);   
  18.       worker.postMessage(40);   
  19.       console.log('我在计算数列的时候执行了', '时间:'+ (new Date()).valueOf() );   
  20.   }     
  21.   script>  
  22. span style="width: auto; height: auto; float: none;" id="15_nwp">a style="text-decoration: none;" mpid="15" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=head&k0=head&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="15_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">headspan>a>span>>  
  23. body>  
  24. body>  
  25. html>  

  在Chrome中打开fibonacci.html,控制台得到如下输出:
 
开始计算:40 时间:1316508212705
我在计算数列的时候执行了 时间:1316508212734
定时器

XML/HTML Code复制内容到剪贴板
  1. span style="width: auto; height: auto; float: none;" id="9_nwp">a style="text-decoration: none;" mpid="9" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=%BA%AF%CA%FD&k0=%BA%AF%CA%FD&kdi0=0&luki=2&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="9_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">函数span>a>span>  

在计算数列时执行了 时间:1316508213735
结果:102334155 时间:1316508262820 用时:50115

  这个例子说明在worker中执行的fibonacci数列的计算并不会影响到主线程的代码执行,完全在自己独立的线程中计算,只是在计算完成之后将结果发回主线程。

  利用web worker我们可以在前端执行一些复杂的大量运算而不会影响页面的展示,并且不会弹出恶心的脚本正忙提示。

  下面这个例子使用了web worker来计算场景中的像素,场景打开时是一片一片进行绘制的,一个worker只计算一块像素值。

  http://nerget.com/rayjs-mt/rayjs.html
  三:Worker的其他尝试

Shakespeare
Shakespeare

一款人工智能文案软件,能够创建几乎任何类型的文案。

下载

  我们已经知道Worker通过接收一个URL来创建一个worker,那么我们是否可以利用web worker来做一些类似jsonp的请求呢,大家知道jsonp是通过插入script标签来加载json数据的,而script元素在加载和执行过程中都是阻塞式的,如果能利用web worker实现异步加载将会非常不错。

  下面这个例子将通过 web worker、jsonp、ajax三种不同的方式来加载一个169.42KB大小的JSON数据

 

立即学习前端免费学习笔记(深入)”;

JavaScript Code复制内容到剪贴板
  1. // /aj/webWorker/core.js   
  2. function $E(id) {   
  3.     return document.getElementById(id);   
  4. }   
  5. onload =function() {   
  6.     //通过web worker加载   
  7.     $E('workerLoad').onclick =function() {   
  8.         var url ='http://js.wcdn.cn/aj/mblog/face2';   
  9.         var d = (new Date()).valueOf();   
  10.         var worker =new Worker(url);   
  11.         worker.onmessage =function(obj) {   
  12.             console.log('web worker: '+ ((new Date()).valueOf() - d));   
  13.         };   
  14.     };   
  15.     //通过jsonp加载   
  16.     $E('jsonpLoad').onclick =function() {   
  17.         var url ='http://js.wcdn.cn/aj/mblog/face1';   
  18.         var d = (new Date()).valueOf();   
  19.         STK.core.io.scriptLoader({   
  20.             method:'post',   
  21.             url : url,   
  22.             onComplete : function() {   
  23.                 console.log('jsonp: '+ ((new Date()).valueOf() - d));   
  24.             }   
  25.         });   
  26.     };   
  27.     //通过ajax加载   
  28.     $E('ajaxLoad').onclick =function() {   
  29.         var url ='http://js.wcdn.cn/aj/mblog/face';   
  30.         var d = (new Date()).valueOf();   
  31.         STK.core.io.ajax({   
  32.             url : url,   
  33.             onComplete : function(json) {   
  34.                 console.log('ajax: '+ ((new Date()).valueOf() - d));   
  35.             }   
  36.         });   
  37.     };   
  38. };  

  HTML页面:/aj/webWorker/worker.html

 

立即学习前端免费学习笔记(深入)”;

XML/HTML Code复制内容到剪贴板
  1. nbsp;HTML>  
  2. html>  
  3. span style="width: auto; height: auto; float: none;" id="4_nwp">a style="text-decoration: none;" mpid="4" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=head&k0=head&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="4_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">headspan>a>span>>  
  4. meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
  5. title>Worker example: load span style="width: auto; height: auto; float: none;" id="5_nwp">a style="text-decoration: none;" mpid="5" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=data&k0=data&kdi0=0&luki=4&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="5_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">dataspan>a>span>title>  
  6. script src="http://js.t.sinajs.cn/STK/js/gaea.1.14.js" type="text/span style="width: auto; height: auto; float: none;" id="6_nwp">a style="text-decoration: none;" mpid="6" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=javascript&k0=javascript&kdi0=0&luki=9&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="6_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">javascriptspan>a>span>">script>  
  7. script type="text/javascript" src="http://js.wcdn.cn/aj/webWorker/core.js">script>  
  8. head>  
  9. body>  
  10.     input type="button" id="workerLoad" value="web worker加载">input>  
  11.     input type="button" id="jsonpLoad" value="jsonp加载">input>  
  12.     input type="button" id="span style="width: auto; height: auto; float: none;" id="7_nwp">a style="text-decoration: none;" mpid="7" target="_blank" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=619521ab1ccffd45&k=ajax&k0=ajax&kdi0=0&luki=8&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=45fdcf1cab219561&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F1183%2Ehtml&urlid=0" id="7_nwl">span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">ajaxspan>a>span>Load" value="ajax加载">input>  
  13. body>  
  14. html>  

  设置HOST
 

复制代码
代码如下:
127.0.0.1 js.wcdn.cn 

  通过 http://js.wcdn.cn/aj/webWorker/worker.html 访问页面然后分别通过三种方式加载数据,得到控制台输出:
 

复制代码
代码如下:
web worker: 174
jsonp: 25
ajax: 38

  多试几次发现通过jsonp和ajax加载数据的时间相差不大,而web worker的加载时间一直处于高位,所以用web worker来加载数据还是比较慢的,即便是大数据量情况下也没任何优势,可能是Worker初始化新起线程比较耗时间。除了在加载过程中是无阻塞的之外没有任何优势。

  那么web worker是否能支持跨域js加载呢,这次我们通过http://127.0.0.1/aj/webWorker/worker.html 来访问页面,当点击 ”web worker加载” 加载按钮时Chrome下无任何反映,FF6下提示错误。由此我们可以知道web worker是不支持跨域加载JS的,这对于将静态文件部署到单独的静态服务器的网站来说是个坏消息。

所以web worker只能用来加载同域下的json数据,而这方面ajax已经可以做到了,而且效率更高更通用。还是让Worker做它自己擅长的事吧。
  四:总结

  web worker看起来很美好,但处处是魔鬼。

  我们可以做什么:

  1.可以加载一个JS进行大量的复杂计算而不挂起主进程,并通过postMessage,onmessage进行通信

  2.可以在worker中通过importScripts(url)加载另外的脚本文件

  3.可以使用 setTimeout(), clearTimeout(), setInterval(), and clearInterval()

  4.可以使用XMLHttpRequest来发送请求

  5.可以访问navigator的部分属性

  有那些局限性:

  1.不能跨域加载JS

  2.worker内代码不能访问DOM

  3.各个浏览器对Worker的实现不大一致,例如FF里允许worker中创建新的worker,而Chrome中就不行

  4.不是每个浏览器都支持这个新特性

相关文章

热门游戏推荐
热门游戏推荐

最近有什么好玩的游戏?最近哪些游戏比较好玩?这里为大家带来热门游戏合集,汇聚了最新最好玩的高分爆款游戏,还在为不知道玩什么游戏而烦恼的玩家,快来保存下载体验吧!

下载

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

相关专题

更多
Golang gRPC 服务开发与Protobuf实战
Golang gRPC 服务开发与Protobuf实战

本专题系统讲解 Golang 在 gRPC 服务开发中的完整实践,涵盖 Protobuf 定义与代码生成、gRPC 服务端与客户端实现、流式 RPC(Unary/Server/Client/Bidirectional)、错误处理、拦截器、中间件以及与 HTTP/REST 的对接方案。通过实际案例,帮助学习者掌握 使用 Go 构建高性能、强类型、可扩展的 RPC 服务体系,适用于微服务与内部系统通信场景。

6

2026.01.15

公务员递补名单公布时间 公务员递补要求
公务员递补名单公布时间 公务员递补要求

公务员递补名单公布时间不固定,通常在面试前,由招录单位(如国家知识产权局、海关等)发布,依据是原入围考生放弃资格,会按笔试成绩从高到低递补,递补考生需按公告要求限时确认并提交材料,及时参加面试/体检等后续环节。要求核心是按招录单位公告及时响应、提交材料(确认书、资格复审材料)并准时参加面试。

28

2026.01.15

公务员调剂条件 2026调剂公告时间
公务员调剂条件 2026调剂公告时间

(一)符合拟调剂职位所要求的资格条件。 (二)公共科目笔试成绩同时达到拟调剂职位和原报考职位的合格分数线,且考试类别相同。 拟调剂职位设置了专业科目笔试条件的,专业科目笔试成绩还须同时达到合格分数线,且考试类别相同。 (三)未进入原报考职位面试人员名单。

37

2026.01.15

国考成绩查询入口 国考分数公布时间2026
国考成绩查询入口 国考分数公布时间2026

笔试成绩查询入口已开通,考生可登录国家公务员局中央机关及其直属机构2026年度考试录用公务员专题网站http://bm.scs.gov.cn/pp/gkweb/core/web/ui/business/examResult/written_result.html,查询笔试成绩和合格分数线,点击“笔试成绩查询”按钮,凭借身份证及准考证进行查询。

6

2026.01.15

Java 桌面应用开发(JavaFX 实战)
Java 桌面应用开发(JavaFX 实战)

本专题系统讲解 Java 在桌面应用开发领域的实战应用,重点围绕 JavaFX 框架,涵盖界面布局、控件使用、事件处理、FXML、样式美化(CSS)、多线程与UI响应优化,以及桌面应用的打包与发布。通过完整示例项目,帮助学习者掌握 使用 Java 构建现代化、跨平台桌面应用程序的核心能力。

63

2026.01.14

php与html混编教程大全
php与html混编教程大全

本专题整合了php和html混编相关教程,阅读专题下面的文章了解更多详细内容。

34

2026.01.13

PHP 高性能
PHP 高性能

本专题整合了PHP高性能相关教程大全,阅读专题下面的文章了解更多详细内容。

74

2026.01.13

MySQL数据库报错常见问题及解决方法大全
MySQL数据库报错常见问题及解决方法大全

本专题整合了MySQL数据库报错常见问题及解决方法,阅读专题下面的文章了解更多详细内容。

20

2026.01.13

PHP 文件上传
PHP 文件上传

本专题整合了PHP实现文件上传相关教程,阅读专题下面的文章了解更多详细内容。

31

2026.01.13

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
HTML5/CSS3/JavaScript/ES6入门课程
HTML5/CSS3/JavaScript/ES6入门课程

共102课时 | 6.7万人学习

HTML+CSS基础与实战
HTML+CSS基础与实战

共132课时 | 9.5万人学习

前端开发(基础+实战项目合集)
前端开发(基础+实战项目合集)

共60课时 | 3.8万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号