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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:14:45+00:00 2026-05-20T03:14:45+00:00

In my Chrome Extension I’m able to get to my ‘punch.php’ file and receive

  • 0

In my Chrome Extension I’m able to get to my ‘punch.php’ file and receive data back, the problem is that I don’t seem to be able to pass data to the file. Here’s my code:

jQuery.fn.punch = function(){
    $(this).click(function(){
        var punchBtn = $(this);
        var ProjectMemberId = '1'
        var ProjectId = '1'
        var str = 'ProjectMemberId='+ProjectMemberId+'&ProjectId='+ProjectId;

        var xhr = new XMLHttpRequest();
        xhr.open("POST", "http://www.ontimepunchcard.com/scripts/punch.php", true);
        xhr.onreadystatechange = function() {
          if (xhr.readyState == 4) {
              $('#PunchBox').html(xhr.responseText);
              if(xhr.responseText==0)
              {
                  punchBtn.removeClass('PunchedIn');
              }
              else
              {
                  punchBtn.addClass('PunchedIn');
              }
          }
        }
    xhr.send('ProjectMemberId='+ProjectMemberId+'&ProjectId='+ProjectId);
    });
}//END PUNCH METHOD

This is a duplication of a normal web application with all of the same code. The Id’s post to ‘punch.php’ and are a part of an SQL statement. The statement was failing with the Chrome extension, and returning an error statement, so I began echoing out the actual SQL query to see what it was trying to do. The result was the SQL query with the two Id’s missing, hence the error and failed query.

Do I have a syntax problem here? Is it possible that though I have the permissions set the way Google says I should, that my extension can only receive data and not send? Is there some other foolishness going on here?

  • 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-20T03:14:45+00:00Added an answer on May 20, 2026 at 3:14 am

    “Are you sure you have proper permissions in your extensions to post data to that file? I just did a simple snippet that I return “1” from responseText. As far as I can see, the snippet is good, as long as it runs in the extension page (not the content script) – Mohamed Mansour Jan 9 at 23:45″

    Apparently this is the answer.

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

Sidebar

Related Questions

I have problem with chrome.extension and jQuery Post. I want post some data (get
I'm creating a chrome extension, and want to be able to get a profile
I'm writing a Chrome extension, and want to write one JS file, that provides
I'm making a chrome extension that requires fetching an xml file from a secure
In a Chrome Extension I am developing, I want to access a data structure
I am writing a chrome extension that is a 'content script' I want to
I am making a chrome extension that will open all links on a page
I am developing a chrome extension, and I want to be able to control
I am making a chrome extension to get urls of all open tabs and
In a chrome extension, I've created tab properties that I'm trying to store with

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.