Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.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/3/html/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
Php 在动态表中使用jQuery替换文本链接_Php_Html_Jquery - Fatal编程技术网

Php 在动态表中使用jQuery替换文本链接

Php 在动态表中使用jQuery替换文本链接,php,html,jquery,Php,Html,Jquery,我正在使用Zend Framework,并使用Zend_Db从数据库中检索行。HTML如下所示。目的是在单击时切换幻灯片列中的“是/否”文本。ajax调用工作并返回正确的结果。但是,我无法选择单元格并更改文本 <table class="table table-bordered table-striped"> <thead> <tr> <th>ID</th>

我正在使用Zend Framework,并使用Zend_Db从数据库中检索行。HTML如下所示。目的是在单击时切换幻灯片列中的“是/否”文本。ajax调用工作并返回正确的结果。但是,我无法选择单元格并更改文本

<table class="table table-bordered table-striped">
            <thead>
            <tr>

                <th>ID</th>
                <th>title</th>
                <th>Caption</th>
                <th>Image</th>
                <th></th>
                <th></th>
                <th>Slideshow</th>
            </tr>
            </thead>
            <tbody>
                <?php
                foreach($this->sections as $section){
                    if($section['slide']==0){ $slideText='No';  }
                    if($section['slide']==1){ $slideText='Yes';  }
                    ?>
                <tr>

                    <td>
                        <span class="badge"><?php echo $section['id']; ?></span>
                    </td>
                    <td>
                        <?php echo $section['caption']; ?>
                    </td>
                    <td>
                        <?php echo $section['comment']; ?>
                    </td>
                    <td>
                        <img src="/images/uploads/<?php echo $section['image_url']; ?>" width="180" height="100">
                    </td>
                    <td><a href="<?php echo $this->url(array('id'=>$section['id'],'sid'=>$this->id, 'type'=>'edit'),'admin-edit')  ?>">Edit</a></td>
                    <td><a href="<?php echo $this->url(array('id'=>$section['id'],'sid'=>$this->id,'type'=>'delete'),'admin-edit')  ?>">Delete</a></td>
                    <td class="imgajax"><a href="<?php echo $this->url(array('id'=>$section['id'],'type'=>'update'),'ajax-admin',true,true)  ?>" class="slide"><?php echo $slideText; ?></a></td>
                </tr>
                    <?php }?>

            </tbody>
        </table>
        <?php } ?>
你应该使用

$('.slide').html('Yes');
而不是

$('.slide').text('Yes');

如果两者都能真正使用的话。然而,即使我使用了.html,它仍然不能工作,然后$('.slide').html('Yes');根本没有人打电话。看看这个。如果有,console.log($('.slide'))中有什么内容?
$('.slide').text('Yes');