0

I try to made a website in full ajax (a html5 website). I use jquery and innerShiv (for ie).

For exemple I want to load all the content of the "section" tag of a page. When I use that script, it works perfectly :

var link = 'http://ajax.wuiwui.net';
$('#new').load(link + ' #contenu');

But when i use this one, I can't find element which aren't into the wordpress loop...

$.ajax({
  url: link,
  processData: false,
  success: function(data){
    data = innerShiv(data,false);
    var truc = $(data).find('#contenu');
    $('#new').append(truc);
  }
});

For my project I want to load some elements with only one ajax request, so the second script is more intersting. But it dont work...

Do you know why ?

My project : http:/ajax.wuiwui.net

Thanks a lot for your help !

  • I solved my problem !! – Willy Jul 13 '11 at 4:14
0

I solved my problem!

In fact, jQuery can't parse an element at the root stage. I just wrap all my body content into a div, and it works.

I can also use filter function instead of find.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.