简单jQuery不是';t在cakephp中工作
我的简单jQuery对话框无法使用cakephp 我的默认ctp是:简单jQuery不是';t在cakephp中工作,jquery,html,cakephp,Jquery,Html,Cakephp,我的简单jQuery对话框无法使用cakephp 我的默认ctp是: <head> <?php echo $this->Html->charset(); ?> <title> <?php echo $cakeDescription ?>: <?php echo $title_for_layout; ?> </title> <?php echo $this->Html->
<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>
和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>
这是用于显示信息的默认对话框。可以使用“x”图标移动、调整和关闭对话框窗口
有人能帮我吗?谢谢…记住要包括适用的
jqueryui.js
和jqueryui.css
工作小提琴:控制台中有输出错误吗?您是否尝试过更改$->jQuery?请将其包装在$(document).ready()中。我相信它正在执行脚本,而页面尚未完成加载。或者您可以将test.js放在页面底部。
.dialog
不是基本jQuery的一部分;您还需要jqueryui。
$(function() {
$( "#dialog" ).dialog();
});
<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>