Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:55:34+00:00 2026-06-14T18:55:34+00:00

When i click a link i need to send post via ajax . The

  • 0

When i click a link i need to send post via ajax. The problem is that the request is dropped because of open a link.

jQuery('#pagination a').click(function(){
    jQuery.post('index.php?option=com_component',
        {checked_sites_for_session: jQuery('.selected-site input[type="checkbox"]').map(function () {return this.value;}).get()}
    ).success(function(){window.location = jQuery(this).attr('href')});
    console.log(jQuery(this).attr('href'));
    return false;
});

But again the problems is (thanks to joomla) in url – its like /~user/joomla/index.php/view-sites?view=sites&page=2 – as you see it starts from slash, but the real link is http://localhost/~user/joomla/index.php/view-sites?view=sites&page=2, but in the source i have <a href="index.php?option=com_component&view=sites&.’.$option.’page=’.$left.'”//….`

So i need some “multipurpose domain parsing solution” or just stop joomla changing my url’s.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:55:36+00:00Added an answer on June 14, 2026 at 6:55 pm

    Using the native element.href will get you the entire href including the domain, and not just the attributes value, also there’s a scope issue with the this keyword being used inside the $,post function :

    $('#pagination a').on('click', function(e){
        e.preventDefault();
        var self = this;
        $.post('index.php?option=com_component',
            {checked_sites_for_session: $('.selected-site input[type="checkbox"]').map(function () {
                     return this.value;
                }).get();
            }
        ).success(function(){
            window.location = self.href;
        });
    });
    

    From the links you’ve posted they don’t look to be the same at all, so you might have to figure something out for that, as some CMS solutions use rewriting etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a function that click one link, send ajax request to 2 pages
I need to display link after each comment, when you click that link, a
When a user clicks a link, I would like to send an AJAX request
How use submit and ajax functions on click event? I need send input hidden
Two things I'm trying to achieve and need help with 1) Click a link
I want to toggle element that id's pg when click link. header: <title>Example</title> <script
When i click a link im calling a servlet. When i click that link
I need to make the datepicker show when I click on a link and
I want to send a link to my friend wall post though a fb
I need to send click information on my website to a third party server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.