title: Chrome Extension: Create a new tab by click a button
body: <p>I am a beginner building a Chrome extension. I have an issue using the function described in the Chrome extension developer doc to make a button to create a new tab in "popup.html". It doesn't work no matter which methods I have tried from Stack Overflow. 
  My code is as follows:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Facebook Connect For Chrome Extension&lt;/title&gt;
  &lt;script type="text/javascript" src="background.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="popup.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function showIndex(){
     var index_url="/index.html",
     chrome.tabs.create({
     url: index_url
     }),
     }
  &lt;/script&gt;
  &lt;body&gt;
  &lt;button value="tab" style="width:100px; height:100px;" onclick="showIndex();"&gt;Go to  Index&lt;/button&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>function createTab() {
      chrome.tabs.create({url: "/index.html"});
  }
  &lt;a href="#" onclick="creatTab();"&gt;Go to Index&lt;/a&gt;
  </code></pre>
  
  <p>Neither option seems to work. </p>
  
  <p>So I wonder whether this function should be placed in background.js? If not, please tell me what's wrong with this code. Thanks in advance! </p>
  
  <p>BTW I changed the URL to <code>www.stackoverflow.com</code>. It is still the same---not working. </p>