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

  • Home
  • SEARCH
  • 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 8025541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:11:47+00:00 2026-06-04T23:11:47+00:00

This is the js code I have put in a content script named ‘detectclicks.js’

  • 0

This is the js code I have put in a content script named ‘detectclicks.js’ to detect clicks on any portion of a web page open in the browser- it uses Jquery— However no alert is being displayed…

$('body').on('click', '*', function(event) {
     window.alert(' ID of element- testing'); 
    window.alert(' ID of element=' + $(this).attr('id'));  // Get ID attribute
    window.alert(' ID of Parent element=' + $(this).parent()..attr('id'));
});

And this is my manifest.json–

{
  "name": "My First Extension",
  "version": "1.0",
  "manifest_version": 2,
  "content_scripts": [
      {
        "matches": ["<all_urls>"],
        "js": ["jquery1.7.2.js", "detectclicks.js"]
      }
   ],
   "description": "The first extension that I made.",
   "browser_action": {
   "default_icon": "icon.png",
   "default_popup": "popup.html"
    } 
}

No alert is being displayed when I load this extension into Google Chrome and visit a web page..click on any part of the page…What am I doing wrong 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-06-04T23:11:49+00:00Added an answer on June 4, 2026 at 11:11 pm

    As discussed in the comments, check it should not be double dots in this line:

    window.alert('ID of Parent element=' + $(this).parent().attr('id'));
    

    Be attentive! 😉

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

Sidebar

Related Questions

I have this code for update: public Boolean update() { try { data.put(ContactsContract.Groups.SHOULD_SYNC, true);
[Rails] Where to put this code? I have a user1 and when another registered
Possible Duplicate: How to put this code in v3 instead v2 map I have
This is the js code that i have currently <script src=jquery.js type=text/javascript></script> <script type=text/javascript>
this is function.php of a wordpress theme that NOD32 says this code have a
I've used this code to have a like btn on my site: <iframe src=http://www.facebook.com/plugins/like.php?href=URL_OF_YOUR_WEBSITE&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80&amp
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Imagine I have this code: var myFunc1 = function(event) { alert(1); } var myFunc2
Say I have this code - public interface ParentInterface1 { public List<? extends ChildInterface1>
Say I have this code: #import <UIKit/UIKit.h> @interface MyView : UIView @end @implementation MyView

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.