2

我的简单 jQuery 对话框不适用于 cakephp。

我的默认 ctp 是:

<head>
<?php echo $this->Html->charset(); ?>
<title>
    <?php echo $cakeDescription ?>:
    <?php echo $title_for_layout; ?>
</title>

<?php
    echo $this->Html->meta('icon');

    echo $this->Html->css('cake.generic');

    echo $this->Html->script('http://code.jquery.com/jquery-1.8.2.js');
    echo $this->Html->script('test');
    echo $this->fetch('meta');
    echo $this->fetch('css');
    echo $this->fetch('script');
?></head>

输出如下:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script><script type="text/javascript" src="/cake/js/test.js"></script>

test.js 已经在“js”文件夹中:

$(function() {
    $( "#dialog" ).dialog();
});

和 paginateste.ctp

<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p></div>

有人能帮我吗?谢谢...

4

1 回答 1

1

请记住包括适用的jquery-ui.jsjquery-ui.css

在这里工作小提琴:

于 2012-10-30T14:57:13.377 回答