Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.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
Jquery 未显示使用的cakephp和ajax的详细信息_Jquery_Cakephp 2.0 - Fatal编程技术网

Jquery 未显示使用的cakephp和ajax的详细信息

Jquery 未显示使用的cakephp和ajax的详细信息,jquery,cakephp-2.0,Jquery,Cakephp 2.0,我有加法运算和它的视图,其中我有4个选项:城市、专科、医院、医生。现在我需要在选择最后一个选项后立即运行ajax调用,并在同一页面上显示上述所有详细信息,包括医生就诊日期、往返时间以及数据库中的动态信息。 DoctorScheduleend()操作视图未创建! 我有这个代码,但找不到问题出在哪里! 请耐心点,帮帮我,伙计们 型号: <?php class DoctorSchedule extends AppModel { public $name='DoctorSchedule'

我有加法运算和它的视图,其中我有4个选项:城市、专科、医院、医生。现在我需要在选择最后一个选项后立即运行ajax调用,并在同一页面上显示上述所有详细信息,包括医生就诊日期、往返时间以及数据库中的动态信息。 DoctorScheduleend()操作视图未创建! 我有这个代码,但找不到问题出在哪里! 请耐心点,帮帮我,伙计们

型号:

<?php 
class DoctorSchedule extends AppModel {
    public $name='DoctorSchedule';
    public $validate = array(
        'name' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'A State Name is required'
            )
        ),
        'country_id' => array('notempty' => array(
            'rule' => array('notempty'),
            'message' => 'Please Select Country'
        ),
        )
    );

    public $belongsTo = array(
        'Doctor' => array(
            'className' => 'Doctor',
            "foreignKey" => 'doctor_id'
        ),
            'Office' => array(
            'className' => 'Office',
            "foreignKey" => 'office_id'
        )
    );
$('#DoctorId').on('change',function()
            {
                if($('#CityId').val()!='')
                {
                    if($('#SpecialtyId').val()!='')
                    {
                        if($('#OfficeId').val()!='')
                        {
                            $.ajax(
                            {
                                dataType: 'text',
                                cache: 'false',
                                url:'<?php echo Router::url(array('controller'=>'Enduser','action'=>'doctorscheduleend'));?>',
                                type: 'POST',
                                data : {"DoctorId": $('#DoctorId').val()},
                                evalScripts : true,
                                success: function (response)
                                {
                                    var y = document.getElementById("ScheduleList").rows.length;
                                    if(y!=0)
                                    {
                                        for(var i=0;i<1;i++)
                                        {
                                            $('#ScheduleList tr').remove();
                                        }
                                    }
                                    $('#ScheduleList').append(response);
                                },
                                error: function (xhr, ajaxOptions, thrownError)
                                {
//                                  showMessage("Error in ajax call.", 'error');
                                }
                            });                  
                        }
                    }
                }
            });

请按照以下步骤操作:

步骤1:在mozilla firefox中使用firbug检查ajax请求

http://localhost/YOUR URL
    Check response
步骤2:如果成功完成,则检查输出是什么,是您想要的相同输出还是其他输出。 步骤3:如果需要,检查更新divs和javascript代码。 第4步:如果输出不正确,则在微观层面调试程序,例如,在每行之后引入echo,然后检查

http://localhost/YOUR URL
    Check response