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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:26:46+00:00 2026-06-11T20:26:46+00:00

In my HTML head I first include jquery.min.js, jquery.couch.js and twitter-bootstrap js (in that

  • 0

In my HTML head I first include jquery.min.js, jquery.couch.js and twitter-bootstrap js (in that order) and then I have a function called logmein() as follows:

<script>
$.couch.urlPrefix = "http://127.0.0.1:5984"
function logmein() {$.couch.login({
    name: "testuser",
    password: "test",
    success: function() { alert("Success!") },
    error: function() { alert("Login failed") }
    });
}
</script>

With username and password hard-coded for testing.

I then have a button:

<button id="submit" class="btn btn-primary" onClick="logmein()">Sign in</button>

When I try and click submit, I get this error:

jquery.couch.js:216 TypeError: 'null' is not an object (evaluating 'resp.error')

However, if I type logmein() directly into Safari’s web developer console, it works just fine! What am I doing wrong here?

Edit: I think it maybe related to this: https://stackoverflow.com/a/6792725/637562 though I don’t quite understand why (to my knowledge, I was running it on the same protocol/host).

  • 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-11T20:26:47+00:00Added an answer on June 11, 2026 at 8:26 pm

    “Solved”

    If anyone else is having this issue, I’m still not exactly sure what caused the problem. Google Chrome gave a more detailed error message, suggesting the same origin policy had been violated, even though I don’t believe this to be the case.

    Despite this, there’s a much simpler solution all without Javascript: the CouchDB Session API.

    <form action="http://127.0.0.1:5984/_session/" method="post">
    <input type="text" name="name">
    <input type="password" name="password">
    <button id="submit">Sign in</button>
    

    Where 127.0.0.1 is a local couchdb instance, and should be replaced with your couchdb server address….

    More details here: http://wiki.apache.org/couchdb/Session_API including how to set up automatic page redirection on form submission.

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

Sidebar

Related Questions

I have 2 HTML files. In First.html I want to include Second.html. When i
Quote from Head first html: You can add padding to the top and bottom
In my html I have <head> <base href=http://mydomain.com/dev/> </head> But my links all go
I have this script in the head of my index.html. I want different scripts
The .html suffix on a filename implies that the document contains html , head
I have 2 models The first model category.rb class Category include Mongoid::Document # Relationships
For example: script.js: function functionFromScriptJS() { alert('inside functionFromScriptJS'); } iframe.html: <html> <head> <script language=Javascript
I have a javascript routine that dynamically creates an HTML page, complete with it's
I have two PHP files: template.php template.html.php The first is the class definition for
I have some javascript that is embedded in the html file like this <html>

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.