2014-11-19
Debug php scripts with eclipse and xdebug on windows


First,get suitable .dll file.

Tailored Installation Instructions

Paste the full output of phpinfo() to the textarea and submit the form.Then follow the output instructions,including download php_xdebug-x…x.dll file;move the downloaded file to path\to\php\extention;add zend_extension = “path\to\xdebug\file” to php.ini file and restart the webserver.

Second,modify php.ini file.Append following contents to php.ini file :

[XDebug]
xdebug.remote_enable = true
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "ip_address_of_server_running_scripts"
xdebug.remote_port = 9000
xdebug.remote_autostart = 1

Output phpinfo() and check if infomation like with Xdebug vx.x.x, Copyright (c) 2002-2014, by Derick Rethans is displayed.And also there’s section named xdebug.Such information proves that the downloaded php_xdebug-x…x.dll file is available.

Third,configure the eclipse.

  • Select browser in General > Web Browser

  • Select XDebug in PHP > Debug

  • Check WorkBench Options in PHP > Debug > WorkBench Options

  • Add a php server in PHP > PHP Servers

  • Click New,input Name and URL

  • Click next and configure server path mapping

  • Run > Debug Configrations

  • Click Debug

Read More
 2014-11-04
HTML The difference between attribute and property


原文链接:HTML: The difference between attribute and property

在这篇短文中我将说明在HTML中attributes和properties的差异。jQuery 1.6引入的.prop()函数增加了许多关于两者差异的问题。我希望这篇文章能够帮助你理解它。

什么是属性(attribute

attributes携带与一个HTML元素相关的附加信息,以

name="value"

形式出现。举例来说,

<div class="my-class"></div>

这里我们有一个div标签,它有一个值为my-classclass属性(attribute)。

什么是特性(property

特性(property)是在HTML DOM树中属性(attribute)的表示。所以上例中会有一个名为className的特性(property),其值为my-class

DIV 节点
|- nodeName = "DIV"
|- className = "my-class"
|-style
    |- ...
|- ...

属性(attribute)和特性(property)的区别

属性(attribute)位于HTML 文本文档/文件,然而特性(property)位于HTML DOM树中。这意味着属性(attribute)不会改变而且始终携带初始(默认)值。然而特性(property)可以改变。举例来说,当用户勾选一个复选框,向文本区输入文本或者使用JavaScript改变特性(property)值时。

这里是直观表示:

假设用户在输入框中输入他的名字"Joe"。这里是一个元素的属性(attribute)和特性(property)的值。

正如你所看到,只有元素的特性(property)值改变了,因为它位于DOM中而且是动态的。但是位于HTML文本中的属性(attribute)值却不会发生变化。

Read More