phew! after wasting half of day on this subtle bug I finally figured
it out, I'll put it here in case others run into the same issue. I
spent most of my time playing around  on client side with firebug,
everything seems just  fine, but once I append some html tag, it does
nothing. when I fell back to the append example from the jquery
website and loaded it from the server side, firefox displayed it as an
XML! then I checked the server side, found the server returns the
webpage with "mimetype="application/xhtml+xml", then I removed it and
It worked.

On Jul 6, 4:05 pm, Slowness Chen <slowness.c...@gmail.com> wrote:
> when I load the html from server side if I append pure text like  $
> ("#show_messages_div").append('xxxx'); it works, but not if I append
> html like  $("#show_messages_div").append('<h2>xxxx</h2>');
>
> On Jul 6, 2:24 pm, Slowness Chen <slowness.c...@gmail.com> wrote:
>
> > by setting a breakpoint, I made sure the "$
> > ("#show_messages_div").append("<li>test</li>");" line is executed, but
> > nothing happens, but if copy this line and execute it in the console,
> > it works, this is so weird.
>
> > On Jul 6, 1:16 pm, Slowness Chen <slowness.c...@gmail.com> wrote:
>
> > > the html is like the following. it works fine if I load it as a local
> > > html file, but when I load it from a server, it doesn't, I printed $
> > > ("#show_messages_div").html() in console but it showed nothing. it
> > > just doesn't make any sense to me. I tried  searching around but found
> > > nothing. can anybody give me a clue? thanks.
>
> > > BTW:when I load it from server side, it shows nothing but if I type "$
> > > ("#show_messages_div").append("dfdfdf")" in console, it works
>
> > > ...
> > > <script  type="text/javascript">
> > > $(document).ready(function() {
> > >         $("#show_messages_div").append('<h2>xxxx</h2>');});
>
> > > </script>
> > > ...
> > > <div id="show_messages_div"  width="300"></div>

Reply via email to