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 8111413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:06:24+00:00 2026-06-06T02:06:24+00:00

I want to post some data to a file via ajax when somebody clicks

  • 0

I want to post some data to a file via ajax when somebody clicks a link. I have the following code which works in all the main browsers except IE 🙁

    <script type="text/javascript">
        $(document).ready(function() {

           $('a').click(function() {

                $.ajax({

                    url: '<?php echo SITE_URL ?>stats/add_click/',
                    type: 'POST',
                    datatype: 'html',
                    data: {

                        id: $(this).attr('data-id'),
                        ip: '<?php echo $_SERVER['REMOTE_ADDR'] ?>'

                    }

                });

                return true;

           });

        });
    </script>

How do I get this to work in IE or debug the code for IE?

Regards

  • 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-06T02:06:31+00:00Added an answer on June 6, 2026 at 2:06 am

    Try using the success callback of ajax to make the redirect. Sounds like IE is aborting the request

    $('a').click(function() {
                $.ajax({
                    url: '<?php echo SITE_URL ?>stats/add_click/',
                    type: 'POST',
                    dataType: 'html',
                    data: {
                        id: $(this).attr('data-id'),
                        ip: '<?php echo $_SERVER['REMOTE_ADDR'] ?>'
                    },                  
                    success:function(){
                        window.location = this.href;
                    }
    
                });
    
                return false;
    
           });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to post some data via javascript to another domain. Something like: http://www.othersite.com/submitfunnyname?name=blah
I want to post some binary data to a website. The file can be
I have a problem. i want to send some data to my iframe.php file..
I want to have some data cache which contains some objects which I can
i want to download a file using ajax via post request using jQuery. here
i have a list of posts. i want print some words of post content
I want to break my string using javascript which is fetching some data from
I have some user specific JavaScript generated content I want to post to the
I have a form and I want the calculations to be done via ajax
I want to post some data to the server, and in response, I want

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.