Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php jQuery按钮未正确显示_Php_Jquery_Html_Jquery Ui - Fatal编程技术网

Php jQuery按钮未正确显示

Php jQuery按钮未正确显示,php,jquery,html,jquery-ui,Php,Jquery,Html,Jquery Ui,我在应用程序中使用jQuery按钮,但由于某些原因,它显示为普通按钮,没有jQuery属性。html标记位于名为ajax.php的单独文件中,jQuery位于主文件中 以下是jQuery的编码: $(".back_to_list").button().live("click", function(){ }); 以下是按钮的html标记: $html = ''; $html .= '<table> <tr>

我在应用程序中使用jQuery按钮,但由于某些原因,它显示为普通按钮,没有jQuery属性。html标记位于名为
ajax.php
的单独文件中,jQuery位于主文件中

以下是jQuery的编码:

$(".back_to_list").button().live("click", function(){
});
以下是按钮的html标记:

    $html = '';
    $html .= '<table>
                <tr>
                    <td><button class="back_to_list" >Back</button></td>
                </tr>
            </table>';

echo $html;
$html='';
$html.='
返回
';
echo$html;

有人知道为什么按钮没有显示为jQuery ui按钮吗?

您必须确保在加载文档时调用.button()代码(如第一个示例中所示):

$(function () { // jQuery "wrapper" for 'run when document is loaded
    $(".back_to_list").button().live("click", function(){
    });
});

编辑:还请注意,从jQuery 1.7开始,它已被弃用,并从jQuery 1.9开始删除。如果您正在运行较新版本的jQuery,这也可能是您的问题。

.button()
来自
jQueryUI
,它不是
jQuery核心的一部分。请注意,它在1.7中被弃用,在1.9 jQuery版本中被删除。@Vucko,这一点已被注意,版本1.7正在用于这个特定的应用程序您在jQuery库下面有jQuery ui插件吗?我在其他地方使用过jQuery按钮,它们都可以工作,但出于某种原因,这个保持不变