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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:09:40+00:00 2026-05-23T09:09:40+00:00

I am working on an AJAX system to submit a form, but I can’t

  • 0

I am working on an AJAX system to submit a form, but I can’t even get my JavaScript to load, the Firebug report is below.

missing ) after argument list
    else if( httpRequest.responseText == 'already logged in' )\n

I poked around the internet and SO, but all I found was errors in quoting. (Example, Another Example). I don’t have anything misquoted, so I really don’t see what is going on. More of my code is below.
(Some unrelated function calls to remove loading messages are removed.)

if(httpRequest.responseText != "failure")  // Works fine!
{
    document.getElementById("result").innerHTML = "[Success message]";
    setTimeout("2000", function(){ window.location.assign("[link to page]");
}
else if(httpRequest.responseText == 'already logged in')  // Similar to above, but fails
{
    document.getElementById("result").innerHTML = "[error message]";
}
else
{
    document.getElementById("result").innerHTML = "[error message]";
}

Might anyone know why this error is called?
(For more members, it might be useful to outline what things cause this error, which would allow this page to work with other code)

  • 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-23T09:09:40+00:00Added an answer on May 23, 2026 at 9:09 am

    If you split your code up a bit more you see the problem:

    setTimeout("2000", function()
    {
        window.location.assign("[link to page]");
    

    So you are missing a } and a );

    setTimeout(function()
    {
        window.location.assign("[link to page]");
    },2000);
    

    Edit: The order of the arguments is wrong as well like Caspar pointed out.

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

Sidebar

Related Questions

im working on a website system its dynamic with javascript/jquery/ajax so i dont know
I have been working on an ajax/php chat system where users can obviously chat
I'm on my second app with Rails and I want to get ajax working.
Working on an AJAX website (HTML,CSS,JavaScript, AJAX, PHP, MySQL). I have multiple javascript functions
this is my very first question. I'm working on a fully Ajax system with
I'm trying to build a system where I can submit data to a database
I'm working on an AJAX login system. Right now, when the user clicks on
I've been working on a system where you can create-read-update-delete to/from a table in
I have an AJAX chat system that I'm working on and so far I
I am working on a Project management system on PHP (CodeIgniter framework), Mysql, AJAX,

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.