小编DrS*_*ove的帖子

括号中的Javascript表达式

var x = (1,2,3);
alert(x);
Run Code Online (Sandbox Code Playgroud)

此表达式的计算结果为3.

这个表达式怎么(1,2,3)称呼?它为什么返回3?

javascript

8
推荐指数
1
解决办法
400
查看次数

CSS偏移属性和静态位置

偏移属性(左,上,下,右)仅适用于非静态位置吗?

它们可以应用于静态定位的元素吗?如果是这样,将它们应用于非静态定位元素有何不同?

css positioning

8
推荐指数
1
解决办法
2万
查看次数

我如何从匿名自我调用函数中公开函数?

 (function(){
   var a = function () {
     alert("hey now!! ");
   };
   return {"hi":function(){return a;}};
 })();

 hi();
Run Code Online (Sandbox Code Playgroud)

这段代码不起作用.我如何公开一个函数?

javascript function

8
推荐指数
2
解决办法
6433
查看次数

IIFE背景问题

在以下构造中:

(function(){

    var x = function(){
        alert('hi!');
    }

    var y = function(){
        alert("hi again!");
    }

    this.show = function(){
        alert("This is show function!");
    }

})();
Run Code Online (Sandbox Code Playgroud)

为什么要this引用window对象?IIFE中的所有内容是否应与全球范围隔离?是xy函数也是window全局对象的属性?

而且,即使我var h = ...在开头使用put :

var h = (function(){

    var x = function(){
        alert('hi!');
    }

    var y = function(){
        alert("hi again!");
    }

    this.show = function(){
        alert("This is show function!");
    }

})();
Run Code Online (Sandbox Code Playgroud)

this仍然指的是窗口对象 - 我可以show()从全局范围调用!怎么会?

javascript this iife

8
推荐指数
2
解决办法
2804
查看次数

"Object.call"是什么意思?

function bb_graphics_GraphicsContext(){
    Object.call(this);
    this.bbdevice=null;
    this.bbmatrixSp=0;
    this.bbix=1.000000;
    this.bbiy=0;
    this.bbjx=0;
    this.bbjy=1.000000;
    this.bbtx=0;
    this.bbty=0;
    this.bbtformed=0;
    this.bbmatDirty=0;
    this.bbcolor_r=0;
    this.bbcolor_g=0;
    this.bbcolor_b=0;
    this.bbalpha=0;
    this.bbblend=0;
    this.bbscissor_x=0;
    this.bbscissor_y=0;
    this.bbscissor_width=0;
    this.bbscissor_height=0;
    this.bbmatrixStack=new_number_array(192);
}
Run Code Online (Sandbox Code Playgroud)

什么Object.call(this)意思?

javascript oop

7
推荐指数
2
解决办法
5525
查看次数

HTTP下载如何工作?

假设我想从http://www.xxx.ууу/example.pdf下载一个名为example.pdf的文件.

也许,我发送GET请求是这样的:

GET /example.pdf HTTP/1.1??
 Host: www.xxx.yyy??
 ??
Run Code Online (Sandbox Code Playgroud)

但下一步是什么?

如何交换http标头?

http download

7
推荐指数
1
解决办法
4538
查看次数

html根元素的css类?

我通过Google Developer Tools找到了此代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class=" js canvas canvastext geolocation crosswindowmessaging websqldatabase no-indexeddb hashchange historymanagement draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms no-csstransforms3d csstransitions  video audio localstorage sessionstorage webworkers applicationcache svg smil svgclippaths no-opera no-mozilla webkit   fontface">
    </html>
Run Code Online (Sandbox Code Playgroud)

这段代码通过html源代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html>
Run Code Online (Sandbox Code Playgroud)

显然这些类是用Javascript生成的.但为什么?为什么这么多的hss根元素的CSS类?

html javascript css

6
推荐指数
1
解决办法
839
查看次数

为什么要编译成中间代码?

为什么Actionscript,Java,C#等编译成中间代码?我知道使用中间代码的跨平台优势.

问题是:与解释的脚本(JS,Python,PHP,Perl等)相比,编译到中间代码有什么好处?

它只是代码混淆吗?或者是什么?

此外,与编译本机代码相比有什么好处?

c# java compiler-construction actionscript

6
推荐指数
2
解决办法
1272
查看次数

电脑怎么划线?

Windows GDI具有以下功能:

搬去();

的LineTo();

它们接受坐标从哪里开始绘图以及在哪里停止绘图.

但这些功能是如何实现的?(特别是LineTo)

他们是否需要计算A点和B点之间的所有点?

这条线是如何绘制的?

graphics gdi

6
推荐指数
1
解决办法
1135
查看次数

.data()究竟是如何将数据附加到元素的?

可能重复:
jQuery .data()如何工作?

 <script>
    $("div").data("test", { first: 16, last: "pizza!" });
    </script>
Run Code Online (Sandbox Code Playgroud)

我想,通过谷歌Chrome开发者工具,我可以看到类似的东西:

<div first="16" last="pizza!"></div>
Run Code Online (Sandbox Code Playgroud)

但我不能.

.data()究竟是如何将数据附加到元素的?有没有机会我可以在不调用.data()方法的情况下查看/检查数据?

javascript jquery

6
推荐指数
1
解决办法
144
查看次数