1

Which method should I use, load() or ajax()? This is not something I have done before, so I'm a little confused what the difference is.

1 Answer 1

2

load() is just a shortcut for ajax() method with certain options. If you only need to fetch page and place it in the dom, you can use load() method. If you need more control over the ajax request, or you need to call it with some other options, then go for ajax().

Sign up to request clarification or add additional context in comments.

3 Comments

@Giorgi I do want to fetch and place the page, ideally I'd like to wait until it loads then fade the page in, would this be a job for ajax()?
@mtwallet ajax() is for controlling the fetching itself and not animations. You can pass callback to load() which will be executed once the request completes.
one last question if I may. Would I have to use unload() first to ensure the div I am placing content into is empty?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.