Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 !

share|improve this question
    
I solved my problem !! –  Willy Jul 13 '11 at 4:14
add comment

1 Answer

up vote 0 down vote accepted

I solved my problem !!

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

I can also use "filter" function instead of "find".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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