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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:37:38+00:00 2026-06-02T08:37:38+00:00

I used a solution given by Chrules found in this discussion: buttons with no

  • 0

I used a solution given by “Chrules” found in this discussion:buttons with no href, onclick etc

like this :

<button id="clickable" >Click Me!!</button>
 ......
$("#clickable").click(function(){
 // Send user to this link
   insertRecord(); //SQLite Code
  location.href = "game.html";
   // location.href = "http://www.takemehere.com"; });

So When i used the location.href like he putted it (= “http://www.takemehere.com“;) The insertRecord() method is done with success (the object is added to the database)

But when I use the location.href = “game.html”; the game.html page is opened but the insertRecord() method is not done i tried to put the full path of game.html but the same problem persist Have you any idea please ? Thank u in advance

  • 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-02T08:37:41+00:00Added an answer on June 2, 2026 at 8:37 am

    I think insertMethod() calls some async functions to do database updating. So you should use a callback before doing anything else.

    Something like this (i don’t know what is inside of insertRecord method);

    function insertRecord(callback) {
      // do all sorts of database job
      // when it's finished
      // fire your callback
      callback();
    }
    
    insertRecord(function() {
      location.href = "page.html";
    });
    

    EDIT: After your comment, i see you already have defined a function to run after sql which is loadAndReset(). So simply put location.href = "page.html" in that function, and it should work.

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

Sidebar

Related Questions

I used the mapping solution from this question to have a joined component. But
Given the following text: This is!!xa simple string!xpattern I would like to get a
Given this input: [1,2,3,4] I'd like to generate the set of spanning sets: [1]
I have used the cURL solution to solve XSS but there is an issue
My VS2008 solution has the following setup. Program1 Program2 Common.dll (used and referenced by
Used code I found on SO to use the COM based Acrobat Reader to
Update: A sample project reproducing this bug can be found here at Microsoft Connect
Given a postscript file that has the following header %!PS-Adobe-3.0 I would like to
Although I can tentatively see a solution to this, I was wondering if there
I recently used a nice little jquery script that loads images with a given

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.