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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:36:58+00:00 2026-05-20T00:36:58+00:00

I’m having trouble submitting an ajax request. I’ve tried to set it up pretty

  • 0

I’m having trouble submitting an ajax request.

I’ve tried to set it up pretty simply just to see if i can get a response

Here is my js:

$(document).ready(function() {
        $('#mainform').submit(function() {
                $.ajax({
                        type: "POST",
                        url: "processform_ajax.php",
                        data: $(this).serializeArray(),
                        dataType: "json",
                        sucess: function (data) {
                                alert("data" . data);
                                //$("#response").append(data);
                        },
                        error: function(error, txt) {
                                alert(error.status);
                        }
                }); 
       });
});

My php is simply this

<?php
        $errors = array ('a' => 'TEST!');
        echo json_encode($errors);
?>                                                                                                                                                              

When I try to run this with the firebug extension i’m seeing the post looks okay. (which it shouldn’t matter at this point, because my php just echo’s out something)

On the response side I’m seeing this error : NS_ERROR_NOT_AVAILABLE

Which leads me to believe it can’t find processform_ajax.php, but when i’ve tried the absolute url in url: “” option above. I can also hit the the php script through the browser’s address bar and get the json response

Any clues?

Thanks

  • 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-05-20T00:36:58+00:00Added an answer on May 20, 2026 at 12:36 am

    NS_ERROR_NOT_AVAILABLE seems like a Firefox “bug/feature” where it tries to submit the call twice.

    Try this… add a return false in your code, like this:-

    $(document).ready(function() {
            $('#mainform').submit(function() {
                    $.ajax({
                        ...
                    }); 
    
                    return false;
           });
    });
    

    This way, once the form is submitted through your JS code, the return false will prevent your “Submit” button from submitting the same request again.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.