Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make JQuery append work in IE 7 and 8?
    text
    copied!<p>This is my code: </p> <pre><code>$("#multimedia-tabs #"+response.currenttab+" #"+response.currenttab+"div").append(divHtml); </code></pre> <p>Where divHtml has the html li tags</p> <p>It works fine in FF and chrome but not in IE7 and 8 :(</p> <p>Tried many alternatives available on this site but no joy!</p> <p>Please help</p> <pre><code>$(document).ready(function() { $("#next").live('click', function(){getMultimedia($(this).attr('page'), $(this).attr('url'));}); $("#previous").live('click', function(){getMultimedia($(this).attr('page'), $(this).attr('url'));}); $("a.page").live('click', function(e){getMultimedia($(this).attr('page'), $(this).attr('url'));}); }); function displayPage(response){ response = JSON.parse(response); $("#multimedia-tabs #"+response.currenttab+" #"+response.currenttab+"div").html(''); var divHtml = ''; for(var i in response.page){ divHtml += '&lt;li&gt;&lt;a class="medialink" href="'+response.page[i].MedUrl+'"&gt;'+response.page[i].MedUrl+'&lt;/a&gt;&lt;/li&gt;'; } divHtml += ''; var target = response.currenttab+'div'; $("#"+response.currenttab+"div").append(divHtml); updatePageLinks(response.currentPage, response.currenttab); } function updatePageLinks(page, currenttab){ $("#multimedia-tabs #"+currenttab+" #previous").attr('page', page-1); $("#multimedia-tabs #"+currenttab+" #next").attr('page', page+1); } function getMultimedia(page,url){ var url = url + "/page/" + page; $.post(url, {"format" : "json"}, function(data){ displayPage(data); }, 'html'); return false; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload