Home > Backend Development > PHP Tutorial > thinkPHP兼容问题

thinkPHP兼容问题

WBOY
Release: 2016-06-20 12:27:41
Original
991 people have browsed it

方法

public function classc(){     $classc_id=$_POST['data'];     $m=M('Classd');    $where['classc_id']=$classc_id;    $query=$m->where($where)->select();      foreach ($query as $key=>$value)     {                            $classname=$query[$key]['classname'];                  }                $this -> assign("classname",$classname);    $this -> display();        }
Copy after login


页面
<textarea id="classc" name="classc" style="width:100%;resize:none" rows="8"></textarea>
Copy after login


JS
<script type="text/javascript">    $(document).ready(function(){        $("#classc").change(function(){            var val=$(this).val();            $("#classd").load("__URL__/classc",{data:val});        });    });</script>
Copy after login


这样写话在IE中能正常获取数据库中数据并且显示,但是在谷歌和火狐中就不显示了。
但是把页面的代码换成:
<div id="classc"></div>
Copy after login
又能正常显示了。

请问这个是什么情况啊,求大神帮帮忙。


回复讨论(解决方案)

这是 jQuery 的问题,与 thinkPHP 无关
$(select).load 是 $.post(url, data, function(d) { $(select).html(d) }) 的缩写形式

textarea 的赋值应用 value
IE 不做区别,非 IE 可能做了限制(很霸道的)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template