in jquery-1.3.2.js.
 $('#jump').live('change', function() {
               alert(1);
  });

  live don't support  'change' event.



2009/8/3 David .Wu <chan1...@gmail.com>

>
> got it, I need to define it again after I use ajax, it will be more
> safe.
>
> On 7月31日, 下午3時25分, rupak mandal <rupakn...@gmail.com> wrote:
> > hi David, you have to bind "jump" in load callback function.
> >  $(function() {
> >        $.ajaxSetup({
> >                cache: false
> >        });
> >
> >        $('#btn').click(function() {
> >                $('div:first').load('b.html',function(){loadCallback();});
> >        });
> >
> > });
> >
> > function  loadCallback()
> > {
> >       $('#jump').live('change', function() {
> >                alert(1);
> >        });
> >
> > }
> >
> > I think this will fulfill your requirement .
> >
> > On Fri, Jul 31, 2009 at 12:28 PM, David .Wu <chan1...@gmail.com> wrote:
> >
> > > If I load b.html in firefox, alert(1) will work, but ont work in IE.
> >
> > > page a.html
> >
> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> > >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > > <html xmlns="http://www.w3.org/1999/xhtml";>
> > > <head>
> > > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > > <title>live</title>
> > > <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
> > > </head>
> >
> > > <body>
> > > <div style="width: 300px; height: 300px; border: 1px solid red;"></
> > > div>
> > > <input type="button" id="btn" value="btn" />
> > > <script>
> > > $(function() {
> > >        $.ajaxSetup({
> > >                cache: false
> > >        });
> >
> > >        $('#btn').click(function() {
> > >                $('div:first').load('b.html');
> > >        });
> >
> > >        $('#jump').live('change', function() {
> > >                alert(1);
> > >        });
> > > });
> > > </script>
> > > </body>
> > > </html>
> >
> > > page b.html
> > > <select id="jump">
> > >        <option value="1">1</option>
> > >    <option value="2">2</option>
> > > </select>




-- 
黄健



杭州原创软件有限公司

杭州市上城区西湖大道18号新东方大厦B座1301(310009)
办公电话:0571-87185582/87879804-1823

电子邮件:hua...@creatsoft.com.cn
公司网址:www.creatsoft.com.cn

Sent from 杭州市, 浙江省, 中国

Reply via email to