Jump to content

Ajax reload content without page refresh


Recommended Posts

  • 3 months later...
  • 2 weeks later...

Hi,

I will answer, so anybody who will search for this issue to be able to find an answer :

First you will have to create a div to the right of your menu in my-account page, where the ajax result will be displayed, let's call that <div class="myaccount_results"></div>

Then create different onclick events for every menu-item from the left.They should have execution code like this: for the addresses link, the JS code will be :

$.ajax({ url: "http://www.yourdomain.com/address?content_only=1" }) .done(function( data ) { $('.myaccount_results').html(data); });

After implementing this don't forget to remove the links (href="xxxx") from the menu-items, or use event.preventDefault()  / event.stopPropagation() to prevent the redirections of the menuitems.

 

Regards, Leo

  • Confused 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...