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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:06:31+00:00 2026-06-01T10:06:31+00:00

Im new on Google Chrome Extensions coding, and i have some basic questions. I

  • 0

Im new on Google Chrome Extensions coding, and i have some basic questions.

I want to make a Chrome Extension, and the scheme is the following:

-a popup window, containing buttons and result fields (popup.html)

-when a button is clicked, i want to trigger an event, this event should connect to a webserver (i make the servlet too), and gather information from the server. (XMLHttpRequest())

-after that, i want my extension to load the gathered information into one of the result fields.

Simple, isn’t it? But i have several problems, right at the beginning:( I started developing with reading tutorials, but i have fog on the main structure of an extension. Now, i started an app, containing a popup.html, manifest.json …
In popup.html theres a result field, and a button

<div id="extension_container">
<div id="header">
    <p id="intro">Result here</p>
    <button type="button" id="button">Click Me!</button>
</div> <!-- END header -->
<div id="content">

</div> <!-- END content -->

When button is clicked, i trigger an event, handeled with jquery, code here:

<script>
    $(document).ready(function(){
        $("#button").click(function(){
            $("#intro").text("Hello, im added");
            alert("Clicked");
        });
    });
</script>

And here comes the problem, in popup.html this doesnt work, if i load it to Chrome, nothing happens. Otherwise, if i open popup.html in browser, not as an extension, everything works fine. So, i think i have basic misunderstandings on extension structures, starting with background pages, background javascript and so on.. 🙁 Could anyone help me?

  • 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-01T10:06:32+00:00Added an answer on June 1, 2026 at 10:06 am

    Testing in Chrome 19.0.1084.1 this worked for me….

    popup.html

    <!doctype html>
    <html>
    <head>
        <script src="jquery-1.7.1.min.js"></script>
        <script src="popup.js"></script>
    </head>
    <body>
        <div id="extension_container">
            <div id="header">
                <p id="intro">Result here</p>
                <button type="button" id="button">Click Me!</button>
            </div> <!-- END header -->
            <div id="content">
            </div> <!-- END content -->
        </div>
    </body>
    </html>
    

    popup.js

    $(document).ready(function() {
        $("#button").click(function() {
            $("#intro").text("Hello, im added");
            alert("Clicked");
        });
    });
    

    Possible Error
    I think what MIGHT be your problem is that you have “manifest_version” : 2 in your manifest and your popup.html looks something like this….

     <!doctype html>
    <html>
    <head>
        <script src="jquery-1.7.1.min.js"></script>
        <!--script src="popup.js"></script-->
        <script>
        $(document).ready(function() {
            $("#button").click(function() {
                $("#intro").text("Hello, im added");
                alert("Clicked");
            });
        });
        </script>
    </head>
    <body>
        <div id="extension_container">
            <div id="header">
                <p id="intro">Result here</p>
                <button type="button" id="button">Click Me!</button>
            </div> <!-- END header -->
            <div id="content">
            </div> <!-- END content -->
         </div>  
    </body>
    </html>
    

    …this wouldnt work because inline scripts arent allowed in manifest version 2.

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

Sidebar

Related Questions

I included some adsense code in my google chrome extension popup file. Unfortunately this
I want to write an extension for Google chrome that detects snippets of source
I have a Google Chrome extension that upon pressing a button executes an xmlhttp
I am using chrome.tabs.create() to open a new tab in my Google Chrome extension.
So I wrote a Google Chrome extension. All I want to do is provide
I have created a chrome extension for the company I work for, and want
I am writing a Google Chrome extension. I have reached the stage where I
I have written an extension for google chrome and I have a bug I
I have recently gained interest in Google Chrome Extensions, so I started looking into
I've created a basic extension for Google Chrome to change the behavior of which

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.