I want to refresh a full page with ajax, after clicking on some initial site link.
Example:
We have opened site www.love.com, it has a link to www.love.com/somepage.html
After we click on this link, full page must be refreshed with ajax (replaced active page by somepage.html)
And there is must be some fadeIn/Out effect, when the page is replaced.
How to?
maybe some plugin can do this, any link?
I know this is an old post, but I think what you're looking for is solved by using the BBQ jQuery plugin: http://benalman.com/projects/jquery-bbq-plugin/
Sounds like you are trying to use jQuery because someone told you you should be using jQuery - the link tag does this job all by itself without any script required
ok - we have to do what our girlfriends tell us to do...
I suppose you could do something like this:
$("body").load("next_page.html");
or
$("html").load("next_page.html");
(would this even work??)Use FAJAX (Fake AJAX). It will give you that 'coolness' that you are looking for. Using these meta tags in your pages will do a full page refresh with fade-in and fade-out effects.
The meta tags only work in IE, but there are ways to get similar results in other browsers using JavaScript.
Well a full-page request kind of contradict the purpose of AJAX,
but if you insist :) you can use a huge div as a placeholder of your page, and use jQuery Load/Ajax
the div would look like this
and the function that you can use
either manually add the function to your link
or use jQuery selector to iterate every anchor
Since the other page is in the same domain you could scrape the other page to retrieve the data you're interested in. You could even replace the entire body tag of the current page with the contents of the body tag in the other page.
The process would go something like: User takes some action on current page to trigger desired action, JavaScript makes AJAX request to fetch somepage.html and stores the result in a string, JavaScript does equivalent of innerHTML (or jQuery.html()) to replace the contents of the current page (or div or whatever) with whatever was retrieved from somepage.html and add special effect.
In theory this would allow you to completely replace the contents of the current page with whatever was fethced from somepage.html.
Just make a link that points there:
ps: I'm a little bit confused though ... you already have a link to that page that causes a new request (full page refresh), why the need for AJAX I wonder ...