Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I implement jQuery UI in a chrome extension
    primarykey
    data
    text
    <p>I'm having a lot of trouble implementing jQueryUI in my chrome extension. I want to implement a selectable in my options page.</p> <p>The chrome extension is a browser action that when clicked redirects the page to a cached version. In my options page, I will let the user choose which cache database to use e.g. Google, Yahoo, Bing, etc.. I want to let them choose via a selectable.</p> <p>selectable: <a href="http://jqueryui.com/selectable/" rel="nofollow">http://jqueryui.com/selectable/</a></p> <p>I'm trying to implement a bare bones version of the selectable- basically just the demo they have, and then I'll build my webpage around the working version, but I can't seem to get it to work.</p> <p>manifest.json:</p> <pre><code>{ "manifest_version": 2, "name": "WebCache", "version": "2.0.0", "description": "View a cached version of a web page", "browser_action": { "default_icon": { "19":"/images/icon.png" }, "default_title": "Cache Page" }, "background": { "scripts": [ "redirect.js" ] }, "options_page": "options.html", "permissions": [ "tabs", "http://*/*", "https://*/*" ] } </code></pre> <p>options.html:</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;jQuery UI Selectable - Serialize&lt;/title&gt; &lt;link rel="stylesheet" href="jQuery/jquery.ui.all.css"&gt; &lt;link rel="stylesheet" href="options.css" /&gt; &lt;link rel="stylesheet" href="jQuery/demos.css"&gt; &lt;link rel="stylesheet" href="jQuery/jquery.ui.base.css"&gt; &lt;link rel="stylesheet" href="jQuery/jquery.ui.all.css"&gt; &lt;link rel="stylesheet" href="jQuery/jquery.ui.core.css"&gt; &lt;link rel="stylesheet" href="jQuery/jquery.ui.selectable.css"&gt; &lt;script src="options.js"&gt;&lt;/script&gt; &lt;script src="jQuery/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="jQuery/jquery.ui.core.js"&gt;&lt;/script&gt; &lt;script src="jQuery/jquery.ui.widget.js"&gt;&lt;/script&gt; &lt;script src="jQuery/jquery.ui.mouse.js"&gt;&lt;/script&gt; &lt;script src="jQuery/jquery.ui.selectable.js"&gt;&lt;/script&gt; &lt;style&gt; #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #FECA40; } #selectable .ui-selected { background: #F39814; color: white; } #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } &lt;/style&gt; &lt;script&gt; $(function() { $( "#selectable" ).selectable({ stop: function() { var result = $( "#select-result" ).empty(); $( ".ui-selected", this ).each(function() { var index = $( "#selectable li" ).index( this ); result.append( " #" + ( index + 1 ) ); }); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p id="feedback"&gt; &lt;span&gt;You've selected:&lt;/span&gt; &lt;span id="select-result"&gt;none&lt;/span&gt;. &lt;/p&gt; &lt;ol id="selectable"&gt; &lt;li class="ui-widget-content"&gt;Item 1&lt;/li&gt; &lt;li class="ui-widget-content"&gt;Item 2&lt;/li&gt; &lt;li class="ui-widget-content"&gt;Item 3&lt;/li&gt; &lt;li class="ui-widget-content"&gt;Item 4&lt;/li&gt; &lt;li class="ui-widget-content"&gt;Item 5&lt;/li&gt; &lt;li class="ui-widget-content"&gt;Item 6&lt;/li&gt; &lt;/ol&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I've pretty much just cut and pasted demo code (and added references to more javascript files), so I'm quite confused as to why it's not working. Right now it displays a list with properly formatted CSS as it does in the example, but the javascript isn't working. Any help is seriously appreciated.</p> <p>Many thanks, Daniel</p> <p>EDIT 2:</p> <p>The javascript works in my editor Coda, but still not in the extension. The css all shows correctly in the extension though.</p>
    singulars
    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.
 

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