title: how to detect the button event by chrome extension
body: <p>I want to detect the button event in the page,I inject my <strong>script.js</strong> strong text file from <strong>background.html</strong>, when button is click,I want to alert some message than let button do his work.
  so I have two question, </p>
  
  <p>1.I try to use <strong>jquery</strong> in my <strong>srcript.js</strong> but its seem not work,i have include jquery file in     <strong>background.html</strong>, how can i use jquery in .js file?</p>
  
  <p>2.how to detect button event when it be click?</p>
  
  <p>below is my code:</p>
  
  <p><strong>background.html</strong></p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script&gt;
    chrome.browserAction.onClicked.addListener(function(tab) {
      chrome.tabs.executeScript(null,{file:'script.js',allFrames:true});
    });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>script.js</strong></p>
  
  <pre><code>if( self.frameElement &amp;&amp; self.frameElement.tagName == "IFRAME" ){
    $(":button").bind("click",function(){
      alert("iframe button");
    });
  }
  else{
    $(":button").bind("click",function(){
      alert("parent button");
    });
  }
  </code></pre>