Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 jQuery help

views
     
TSJusticeDeserves
post Mar 1 2010, 05:09 PM, updated 16y ago

Regular
******
Senior Member
1,914 posts

Joined: Aug 2009


Hi, I need help. I'm using the jQuery.Form plugin to manage my ajax requests. So this is my script:
CODE
$('#log_in_form form').ajaxForm({
 url: 'http://localhost/admin/login-ajax.php',
 success:
  function(data) {
   if(data == 1) {
    $('#page').slideUp('slow');
    var toLoad = window.location+' #page';
    $('#page').load(toLoad,'');
    $('#page').slideDown('slow');
    $('#bg_layer').fadeOut('slow');
    $('#log_in_form').fadeOut('slow');
   }
   else {
    $('#user_not_found').slideDown();
    $('#log_in_form_username input').focus(
     function() {
      $('#user_not_found').slideUp('fast');
     }
    );
    $('#log_in_form_password input').focus(
     function() {
      $('#user_not_found').slideUp('fast');
     }
    );
   }
  }
});

See this part:
$('#page').slideUp('slow');
var toLoad = window.location+' #page';
$('#page').load(toLoad,'');
$('#page').slideDown('slow');
When that script is carried out, the other effects on the page is gone. How come? All the effects on the page, including navigation, social icons etc etc.

I cant seem to find out what Im doing wrong, anyone willing to help? Thaaaaaanks
pufferfish
post Mar 1 2010, 07:18 PM

Casual
***
Junior Member
439 posts

Joined: Oct 2005


can paste the whole thing here ar?
nyem
post Mar 1 2010, 08:18 PM

Enthusiast
*****
Senior Member
751 posts

Joined: Jan 2007


The correct use of load is to attach external page into current document
CODE
$('#result').load('ajax/test.html');


I think you're trying to load the same document as already loaded. Disable these lines
QUOTE(JusticeDeserves @ Mar 1 2010, 05:09 PM)
var toLoad = window.location+' #page';
$('#page').load(toLoad,'');
SanosukeSagara
post Mar 1 2010, 08:30 PM

2008 2008
******
Senior Member
1,193 posts

Joined: Jan 2003
From: Sungai Petani



$('#page').slideUp('slow');
var toLoad = window.location+' #page';
$('#page').load(toLoad,'');
$('#page').slideDown('slow');

I dont think it will work..

Normally I will do like this.. $('#page').load(toLoad,'').slideDown('slow');
or you need to use animate
TSJusticeDeserves
post Mar 2 2010, 01:48 PM

Regular
******
Senior Member
1,914 posts

Joined: Aug 2009


QUOTE(nyem @ Mar 1 2010, 08:18 PM)
The correct use of load is to attach external page into current document
CODE
$('#result').load('ajax/test.html');


I think you're trying to load the same document as already loaded. Disable these lines
*
Thanks dude, that helped.

 

Change to:
| Lo-Fi Version
0.0161sec    0.67    5 queries    GZIP Disabled
Time is now: 14th December 2025 - 07:40 AM