JQUERY JSON load page into div not working

JQUERY JSON load page into div not working

I am really lost here.....i have written a little function to check if the username/password of a certain user is correct using a json query. If result is ok i want to load a certain page into a div, if the result is error i want to load a different page into a div. Any help / explantion would be really much appreciated

Normally i would use   $('#test').load("members.php"); to achieve this but it just isnt working (my div has an id of test - members is the page to be loaded.

  1. function dologin(){
  2. var email = $('#email').val();
  3. var wachtwoord = $('#wachtwoord').val();
  4. if($.trim(email) != '' && $.trim(wachtwoord) != ''){
  5. $.post("login2.php", {email:email,wachtwoord:wachtwoord})
  6. .done(function(data) {
  7. var response    = jQuery.parseJSON(data);
  8. var result = response.result;

  9. if(result == 'ok'){
  10.      $('#test').load("members.php");
  11. return false;
  12. // logged on
  13. }else{
  14. // error
  15. $('#test').load("loginfailed.php");
  16. }

  17. }, "json");
  18. }
  19. }