I have just run this script (changed name of called script and
params)...

$(document).ready(function(){
$.get("test.php", {itemId:'foo', mediaType:'bar'}, function(data){
    alert("Data Loaded: " + data);
    $("#playlist div.scrollbox").append(data);
  });
});

against this HTML...

<div id='playlist'>
  <div class='scrollbox'>
  </div>
</div>

retrieving this PHP script (HTML lifted directly from previous
post)...

<?php
?>
<div id="137" onclick="playItem('','137','1');return false;">
    <img onclick="return false;" alt=""
src="/shared/WiseImage.ashx?
Image=albm_98_633126866844334376.jpg&height=33&cropwidth=33"/>
    <b></b> (Video) 0:00
    <span></span>
    <span class="close"/>
</div>

in both FF2 and IE7, using jQuery v1.2.1, and both worked perfectly.
The alert went off, and the HTML was appended to div.scrollbox.
I removed the alert ... no problem.
I added other content to div.scrollbox ... no problem.


On Nov 20, 2:49 am, "Shawn Molloy" <[EMAIL PROTECTED]> wrote:
> The HTML that is inside of the data var looks like this:
>
> <div id="137" onclick="playItem('','137','1');return false;">
>     <img onclick="return false;" alt=""
> src="/shared/WiseImage.ashx?Image=albm_98_633126866844334376.jpg&height=33&cropwidth=33"/>
>     <b></b> (Video) 0:00
>     <span></span>
>     <span class="close"/>
> </div>
>
> Seems like its formed all right to me. Could it be the output mode or
> content type of the page (its asp.net)? Thanks for taking a look.
>
> On Nov 19, 2007 8:19 AM, kef <[EMAIL PROTECTED]> wrote:
>
>
>
> > Most of the problems I've personally had with .append is when my xhtml
> > is malformed or I'm not escaping something properly.
>
> > On Nov 19, 5:20 am, James Dempster <[EMAIL PROTECTED]> wrote:
> > > append expects html data starting with a html element e.g <div or an
> > > element please check that this is the case. can you provide an example
> > > of what data contains?
>
> > > On Nov 18, 8:31 pm, Shawn <[EMAIL PROTECTED]> wrote:
>
> > > > Hello, this code doesn't seem to insert or append any HTML when I call
> > > > it,
> > > > but it does insert the HTML when I use the HTML() function.
>
> > > > *
> > > > This does not work.*
> > > > function queue(itemId, mediaType) {
> > > >    $.get("ajax/getPlaylistItem.aspx", {itemId: itemId, mediaType:
> > > > mediaType}, function(data){
> > > >       alert("Data Loaded: " + data);$("#playlist
> > > > div.scrollbox").append(data);
>
> > > >     });
>
> > > > }
>
> > > > *
> > > > This works!*
> > > > function queue(itemId, mediaType) {
> > > >    $.get("ajax/getPlaylistItem.aspx", {itemId: itemId, mediaType:
> > > > mediaType}, function(data){
> > > >       alert("Data Loaded: " + data);$("#playlist
> > > > div.scrollbox").html(data);
> > > > // append() doesnt work!
> > > >     });
>
> > > > }
>
> > > > I've also tried a couple other methods of inserting data, but they
> > > > didn't
> > > > respond either.
>
> > > > Thanks,
>
> > > > -- shawn- Hide quoted text -
>
> > > - Show quoted text -

Reply via email to