Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome Extension/Javascript Problems
    primarykey
    data
    text
    <p>I have been working on Chrome extension and am having problems. What I'm trying to do: when you click on the icon to the right of the search bar, a search bar comes up which you type your query in and hit enter. It will then go to <a href="http://dev.bukkit.org/search/?search=(whatever" rel="nofollow">http://dev.bukkit.org/search/?search=(whatever</a> was entered). This is what I have but it is not working.</p> <pre><code>&lt;scriptLANGUAGE="JavaScript"&gt; function whatURL() { window.location= 'http://dev.bukkit.org/search/?search=' + document.form1.url.value; } &lt;/SCRIPT&gt; &lt;FORM name=form1&gt; &lt;inputtype="text"id="url"&gt; &lt;inputtype="button"id="btnSearch"value="Search"onClick="return whatURL()"/&gt; &lt;/FORM&gt; </code></pre> <p>Thank you:) Note: I have the manifest and everything, its just the javascript part thats not working. EDIT: Rewrote it now it works!!!</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script&gt; function onLoad() { document.getElementById("mytextfield").focus(); } function onKeyPress(e) { if (e.keyCode == 13) { openResults(); } } function openHomePage() { window.open("http://dev.bukkit.org/"); } function openResults() { window.open("http://dev.bukkit.org/search/?search=" + encodeURIComponent(document.getElementById("mytextfield").value)); } &lt;/script&gt; &lt;/head&gt; &lt;body onload="onLoad();"&gt; &lt;img src="png-3.png" onclick="openHomePage();" style="border-width: 0px; cursor: pointer" /&gt;&lt;br&gt; &lt;div name="myFormDiv" style="center: 6px;"&gt; &lt;br&gt; &lt;input type="search" id="mytextfield" name="mytextfield" value="Search..." onkeypress="onKeyPress(event);" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload