Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

CS Cart - ZBA Z-3010 Scanner Aus Post Express Post tracking code input favlet

1
2
3
4
5
/* CS CART 2.x */
javascript:(function(){/*Scanner Postage Tracking7 Aug 2013Quick fix as the scanner adds 5 numerals at the start of the Australia Post Express Post tracking codes and does a carriage returnRMW Web Publishing*/if($('#content_add_shipment:visible').length>0){var scanned=$('#shipment_comments').val();if(scanned.length>0){scanned=scanned.trim();scanned=scanned.slice(4);/* example '997960402908127094' return 60402908127094 */if(scanned.length===14){$('#tracking_number').val(scanned).focus();$('#shipment_comments').val('');}else{alert('Something sus happened - the code is not correct. Please fix manually');return;}}else{alert('Please scan code into the "Comments" field');}/* Set Carrier to Australia Post */$('#carrier_key option[value="AUP"]').attr('selected','selected');/* Set Order Status to Posted */$('#order_status option[value="C"]').attr('selected','selected');/* Set Notification to True */$('#shipment_notify_user').attr('checked','checked');}else{alert('CS Cart "New Shipment" dialogue not active');}})()

/* CS CART 4.x */
javascript:!function(){!function(){if($('form[name=%22shipments_form%22]:visible').length%3E0){var%20e=$(%22%23shipmentcomments%22).val();if(e.length%3E0){if(e=e.trim(),e=e.slice(4),14!==e.length)return%20void%20alert(%22Somethings%20wrong%20-%20the%20code%20is%20not%20correct.%20Please%20fix%20manually%22);$(%22%23tracking_number%22).val(e).focus(),$(%22%23shipmentcomments%22).val(%22%22)}else%20alert('Please%20scan%20code%20into%20the%20%22Comments%22%20field');$('%23carrier_key%20option[value=%22aup%22]').prop(%22selected%22,!0),$('%23order_status%20option[value=%22C%22]').prop(%22selected%22,!0),$(%22%23shipment_notify_user%22).prop(%22checked%22,!0)}else%20alert('Unable%20to%20find%20CS%20Cart%20%22New%20Shipment%22%20modal')}()}();
https://snipt.net/embed/2693ff9953ca2d4d080614b35ea6a710/
https://snipt.net/raw/2693ff9953ca2d4d080614b35ea6a710/
2693ff9953ca2d4d080614b35ea6a710
js
JavaScript
5
2016-12-04T05:10:26
True
False
False
/api/public/snipt/72417/
cs-cart-zba-z-3010-scanner-aus-post-express-post-tracking-code-input-favlet
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cm">/* CS CART 2.x */</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">javascript</span><span class="o">:</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="cm">/*Scanner Postage Tracking7 Aug 2013Quick fix as the scanner adds 5 numerals at the start of the Australia Post Express Post tracking codes and does a carriage returnRMW Web Publishing*/</span><span class="k">if</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#content_add_shipment:visible&#39;</span><span class="p">).</span><span class="nx">length</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">){</span><span class="kd">var</span> <span class="nx">scanned</span><span class="o">=</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_comments&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span><span class="k">if</span><span class="p">(</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">length</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">){</span><span class="nx">scanned</span><span class="o">=</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">trim</span><span class="p">();</span><span class="nx">scanned</span><span class="o">=</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">4</span><span class="p">);</span><span class="cm">/* example &#39;997960402908127094&#39; return 60402908127094 */</span><span class="k">if</span><span class="p">(</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">length</span><span class="o">===</span><span class="mi">14</span><span class="p">){</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#tracking_number&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">scanned</span><span class="p">).</span><span class="nx">focus</span><span class="p">();</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_comments&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">);}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Something sus happened - the code is not correct. Please fix manually&#39;</span><span class="p">);</span><span class="k">return</span><span class="p">;}}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Please scan code into the &quot;Comments&quot; field&#39;</span><span class="p">);}</span><span class="cm">/* Set Carrier to Australia Post */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#carrier_key option[value=&quot;AUP&quot;]&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;selected&#39;</span><span class="p">,</span><span class="s1">&#39;selected&#39;</span><span class="p">);</span><span class="cm">/* Set Order Status to Posted */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#order_status option[value=&quot;C&quot;]&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;selected&#39;</span><span class="p">,</span><span class="s1">&#39;selected&#39;</span><span class="p">);</span><span class="cm">/* Set Notification to True */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_notify_user&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;checked&#39;</span><span class="p">,</span><span class="s1">&#39;checked&#39;</span><span class="p">);}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;CS Cart &quot;New Shipment&quot; dialogue not active&#39;</span><span class="p">);}})()</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="cm">/* CS CART 4.x */</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">javascript</span><span class="o">:!</span><span class="kd">function</span><span class="p">(){</span><span class="o">!</span><span class="kd">function</span><span class="p">(){</span><span class="k">if</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;form[name=%22shipments_form%22]:visible&#39;</span><span class="p">).</span><span class="nx">length</span><span class="o">%</span><span class="mi">3</span><span class="nx">E0</span><span class="p">){</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">e</span><span class="o">=</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipmentcomments</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span><span class="k">if</span><span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">length</span><span class="o">%</span><span class="mi">3</span><span class="nx">E0</span><span class="p">){</span><span class="k">if</span><span class="p">(</span><span class="nx">e</span><span class="o">=</span><span class="nx">e</span><span class="p">.</span><span class="nx">trim</span><span class="p">(),</span><span class="nx">e</span><span class="o">=</span><span class="nx">e</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span><span class="mi">14</span><span class="o">!==</span><span class="nx">e</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span><span class="k">return</span><span class="o">%</span><span class="mi">20</span><span class="k">void</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">Somethings</span><span class="o">%</span><span class="mi">20</span><span class="nx">wrong</span><span class="o">%</span><span class="mi">20</span><span class="o">-%</span><span class="mi">20</span><span class="nx">the</span><span class="o">%</span><span class="mi">20</span><span class="nx">code</span><span class="o">%</span><span class="mi">20</span><span class="nx">is</span><span class="o">%</span><span class="mi">20</span><span class="nx">not</span><span class="o">%</span><span class="mi">20</span><span class="nx">correct</span><span class="p">.</span><span class="o">%</span><span class="mi">20</span><span class="nx">Please</span><span class="o">%</span><span class="mi">20</span><span class="nx">fix</span><span class="o">%</span><span class="mi">20</span><span class="nx">manually</span><span class="o">%</span><span class="mi">22</span><span class="p">);</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">tracking_number</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">e</span><span class="p">).</span><span class="nx">focus</span><span class="p">(),</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipmentcomments</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">22</span><span class="p">)}</span><span class="k">else</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Please%20scan%20code%20into%20the%20%22Comments%22%20field&#39;</span><span class="p">);</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;%23carrier_key%20option[value=%22aup%22]&#39;</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">selected</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">),</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;%23order_status%20option[value=%22C%22]&#39;</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">selected</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">),</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipment_notify_user</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">checked</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">)}</span><span class="k">else</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Unable%20to%20find%20CS%20Cart%20%22New%20Shipment%22%20modal&#39;</span><span class="p">)}()}();</span> </span></pre></div> </td></tr></table>
auspost, barcode, bookmarklet, cscart, cscart4, ecommerce, favlet, scanned, shipping, shopping, store, tracking, z-3010

Text only

Show passwords on web page

javascript:(function(){var%20s,F,j,f,i;%20s%20=%20"";%20F%20=%20document.forms;%20for(j=0;%20j<F.length;%20++j)%20{%20f%20=%20F[j];%20for%20(i=0;%20i<f.length;%20++i)%20{%20if%20(f[i].type.toLowerCase()%20==%20"password")%20s%20+=%20f[i].value%20+%20"\n";%20}%20}%20if%20(s)%20alert("Passwords%20in%20forms%20on%20this%20page:\n\n"%20+%20s);%20else%20alert("There%20are%20no%20passwords%20in%20forms%20on%20this%20page.");})();
https://snipt.net/embed/8643b839ae7c22fb534523e19ee369e3/
https://snipt.net/raw/8643b839ae7c22fb534523e19ee369e3/
8643b839ae7c22fb534523e19ee369e3
text
Text only
1
2016-11-27T16:24:22
True
False
False
Jan 04, 2016 at 06:34 PM
/api/public/snipt/64274/
show-passwords-on-web-page
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>javascript:(function(){var%20s,F,j,f,i;%20s%20=%20&quot;&quot;;%20F%20=%20document.forms;%20for(j=0;%20j&lt;F.length;%20++j)%20{%20f%20=%20F[j];%20for%20(i=0;%20i&lt;f.length;%20++i)%20{%20if%20(f[i].type.toLowerCase()%20==%20&quot;password&quot;)%20s%20+=%20f[i].value%20+%20&quot;\n&quot;;%20}%20}%20if%20(s)%20alert(&quot;Passwords%20in%20forms%20on%20this%20page:\n\n&quot;%20+%20s);%20else%20alert(&quot;There%20are%20no%20passwords%20in%20forms%20on%20this%20page.&quot;);})(); </span></pre></div> </td></tr></table>
bookmarklet, passwords

JavaScript

JavaScript for Bookmarklet to pass URL to form field

1
2
3
4
5
6
7
(function (formurl, site, name, options) {
    window.open(
        formurl+encodeURIComponent(site),
        name,
        options
    );
}('http://example.com?url=', window.location, 'yourform', 'width=300,height=200'));
https://snipt.net/embed/b5c601ac948d1f1b51020b0c643adff0/
https://snipt.net/raw/b5c601ac948d1f1b51020b0c643adff0/
b5c601ac948d1f1b51020b0c643adff0
js
JavaScript
7
2016-11-30T02:47:21
True
False
False
Jan 13, 2013 at 09:20 AM
/api/public/snipt/53424/
javascript-for-bookmarklet-to-pass-url-to-form-field
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">formurl</span><span class="p">,</span> <span class="nx">site</span><span class="p">,</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">options</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">window</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">formurl</span><span class="o">+</span><span class="nb">encodeURIComponent</span><span class="p">(</span><span class="nx">site</span><span class="p">),</span> </span><span id="L-4"><a name="L-4"></a> <span class="nx">name</span><span class="p">,</span> </span><span id="L-5"><a name="L-5"></a> <span class="nx">options</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">);</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}(</span><span class="s1">&#39;http://example.com?url=&#39;</span><span class="p">,</span> <span class="nb">window</span><span class="p">.</span><span class="nx">location</span><span class="p">,</span> <span class="s1">&#39;yourform&#39;</span><span class="p">,</span> <span class="s1">&#39;width=300,height=200&#39;</span><span class="p">));</span> </span></pre></div> </td></tr></table>
"url variable", bookmarklet, javascript, url

JavaScript

jQuerfiy Bookmarklet

javascript:(function(){var el=document.createElement("div"),b=document.getElementsByTagName("body")[0],otherlib=!1,msg="";el.style.position="fixed",el.style.height="32px",el.style.width="220px",el.style.marginLeft="-110px",el.style.top="0",el.style.left="50%25",el.style.padding="5px 10px",el.style.zIndex=1001,el.style.fontSize="12px",el.style.color="#222",el.style.backgroundColor="#f99";function showMsg(){var txt=document.createTextNode(msg);el.appendChild(txt),b.appendChild(el),window.setTimeout(function(){txt=null,typeof jQuery=="undefined"?b.removeChild(el):(jQuery(el).fadeOut("slow",function(){jQuery(this).remove()}),otherlib&&(window.$=jQuery.noConflict()))},2500)}if(typeof jQuery!="undefined")return msg="This page already using jQuery v"+jQuery.fn.jquery,showMsg();typeof $=="function"&&(otherlib=!0);function getScript(url,success){var script=document.createElement("script");script.src=url;var head=document.getElementsByTagName("head")[0],done=!1;script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")&&(done=!0,success(),script.onload=script.onreadystatechange=null,head.removeChild(script))},head.appendChild(script)}getScript("http://code.jquery.com/jquery-latest.min.js",function(){return typeof jQuery=="undefined"?msg="Sorry, but jQuery was not able to load":(msg="This page is now jQuerified with v"+jQuery.fn.jquery,otherlib&&(msg+=" and noConflict(). Use $jq(), not $().")),showMsg()})})();
https://snipt.net/embed/77069b54f508601283d6684b6b50bf1f/
https://snipt.net/raw/77069b54f508601283d6684b6b50bf1f/
77069b54f508601283d6684b6b50bf1f
js
JavaScript
1
2016-11-17T16:44:40
True
False
False
Oct 25, 2012 at 01:21 PM
/api/public/snipt/49051/
jquerfiy-bookmarklet
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">javascript</span><span class="o">:</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="kd">var</span> <span class="nx">el</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">),</span><span class="nx">b</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;body&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span><span class="nx">otherlib</span><span class="o">=!</span><span class="mi">1</span><span class="p">,</span><span class="nx">msg</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">;</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">position</span><span class="o">=</span><span class="s2">&quot;fixed&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">height</span><span class="o">=</span><span class="s2">&quot;32px&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span><span class="o">=</span><span class="s2">&quot;220px&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">marginLeft</span><span class="o">=</span><span class="s2">&quot;-110px&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">top</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span><span class="o">=</span><span class="s2">&quot;50%25&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">padding</span><span class="o">=</span><span class="s2">&quot;5px 10px&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">zIndex</span><span class="o">=</span><span class="mi">1001</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontSize</span><span class="o">=</span><span class="s2">&quot;12px&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">color</span><span class="o">=</span><span class="s2">&quot;#222&quot;</span><span class="p">,</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">backgroundColor</span><span class="o">=</span><span class="s2">&quot;#f99&quot;</span><span class="p">;</span><span class="kd">function</span> <span class="nx">showMsg</span><span class="p">(){</span><span class="kd">var</span> <span class="nx">txt</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">createTextNode</span><span class="p">(</span><span class="nx">msg</span><span class="p">);</span><span class="nx">el</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">txt</span><span class="p">),</span><span class="nx">b</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">),</span><span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="nx">txt</span><span class="o">=</span><span class="kc">null</span><span class="p">,</span><span class="k">typeof</span> <span class="nx">jQuery</span><span class="o">==</span><span class="s2">&quot;undefined&quot;</span><span class="o">?</span><span class="nx">b</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span><span class="o">:</span><span class="p">(</span><span class="nx">jQuery</span><span class="p">(</span><span class="nx">el</span><span class="p">).</span><span class="nx">fadeOut</span><span class="p">(</span><span class="s2">&quot;slow&quot;</span><span class="p">,</span><span class="kd">function</span><span class="p">(){</span><span class="nx">jQuery</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">remove</span><span class="p">()}),</span><span class="nx">otherlib</span><span class="o">&amp;&amp;</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">$</span><span class="o">=</span><span class="nx">jQuery</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">()))},</span><span class="mi">2500</span><span class="p">)}</span><span class="k">if</span><span class="p">(</span><span class="k">typeof</span> <span class="nx">jQuery</span><span class="o">!=</span><span class="s2">&quot;undefined&quot;</span><span class="p">)</span><span class="k">return</span> <span class="nx">msg</span><span class="o">=</span><span class="s2">&quot;This page already using jQuery v&quot;</span><span class="o">+</span><span class="nx">jQuery</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">jquery</span><span class="p">,</span><span class="nx">showMsg</span><span class="p">();</span><span class="k">typeof</span> <span class="nx">$</span><span class="o">==</span><span class="s2">&quot;function&quot;</span><span class="o">&amp;&amp;</span><span class="p">(</span><span class="nx">otherlib</span><span class="o">=!</span><span class="mi">0</span><span class="p">);</span><span class="kd">function</span> <span class="nx">getScript</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span><span class="nx">success</span><span class="p">){</span><span class="kd">var</span> <span class="nx">script</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;script&quot;</span><span class="p">);</span><span class="nx">script</span><span class="p">.</span><span class="nx">src</span><span class="o">=</span><span class="nx">url</span><span class="p">;</span><span class="kd">var</span> <span class="nx">head</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;head&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span><span class="nx">done</span><span class="o">=!</span><span class="mi">1</span><span class="p">;</span><span class="nx">script</span><span class="p">.</span><span class="nx">onload</span><span class="o">=</span><span class="nx">script</span><span class="p">.</span><span class="nx">onreadystatechange</span><span class="o">=</span><span class="kd">function</span><span class="p">(){</span><span class="o">!</span><span class="nx">done</span><span class="o">&amp;&amp;</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">readyState</span><span class="o">||</span><span class="k">this</span><span class="p">.</span><span class="nx">readyState</span><span class="o">==</span><span class="s2">&quot;loaded&quot;</span><span class="o">||</span><span class="k">this</span><span class="p">.</span><span class="nx">readyState</span><span class="o">==</span><span class="s2">&quot;complete&quot;</span><span class="p">)</span><span class="o">&amp;&amp;</span><span class="p">(</span><span class="nx">done</span><span class="o">=!</span><span class="mi">0</span><span class="p">,</span><span class="nx">success</span><span class="p">(),</span><span class="nx">script</span><span class="p">.</span><span class="nx">onload</span><span class="o">=</span><span class="nx">script</span><span class="p">.</span><span class="nx">onreadystatechange</span><span class="o">=</span><span class="kc">null</span><span class="p">,</span><span class="nx">head</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">script</span><span class="p">))},</span><span class="nx">head</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">script</span><span class="p">)}</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://code.jquery.com/jquery-latest.min.js&quot;</span><span class="p">,</span><span class="kd">function</span><span class="p">(){</span><span class="k">return</span> <span class="k">typeof</span> <span class="nx">jQuery</span><span class="o">==</span><span class="s2">&quot;undefined&quot;</span><span class="o">?</span><span class="nx">msg</span><span class="o">=</span><span class="s2">&quot;Sorry, but jQuery was not able to load&quot;</span><span class="o">:</span><span class="p">(</span><span class="nx">msg</span><span class="o">=</span><span class="s2">&quot;This page is now jQuerified with v&quot;</span><span class="o">+</span><span class="nx">jQuery</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">jquery</span><span class="p">,</span><span class="nx">otherlib</span><span class="o">&amp;&amp;</span><span class="p">(</span><span class="nx">msg</span><span class="o">+=</span><span class="s2">&quot; and noConflict(). Use $jq(), not $().&quot;</span><span class="p">)),</span><span class="nx">showMsg</span><span class="p">()})})();</span> </span></pre></div> </td></tr></table>
bookmarklet, javascript, jquery

HTML

Facebook Debugger Bookmarklet

// Create a new bookmark in your browser and add the following line as the bookmark URL
javascript:void(document.location='https://developers.facebook.com/tools/debug/og/object?q='+encodeURI(location.href))
https://snipt.net/embed/4f4395555db865a4edf05c962c17664e/
https://snipt.net/raw/4f4395555db865a4edf05c962c17664e/
4f4395555db865a4edf05c962c17664e
html
HTML
2
2016-12-03T00:30:50
True
False
False
/api/public/snipt/46726/
facebook-debugger-bookmarklet
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>// Create a new bookmark in your browser and add the following line as the bookmark URL </span><span id="L-2"><a name="L-2"></a>javascript:void(document.location=&#39;https://developers.facebook.com/tools/debug/og/object?q=&#39;+encodeURI(location.href)) </span></pre></div> </td></tr></table>
bookmarklet, debugger, facebook, tool

JavaScript

Clear CSS cache in Firefox bookmarklet

javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})();
https://snipt.net/embed/6aeca59c5b12172f0ddadf09d40acd3c/
https://snipt.net/raw/6aeca59c5b12172f0ddadf09d40acd3c/
6aeca59c5b12172f0ddadf09d40acd3c
js
JavaScript
1
2016-12-02T11:06:22
True
False
False
Aug 25, 2012 at 04:58 AM
/api/public/snipt/46283/
clear-css-cache-in-firefox-bookmarklet
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">javascript</span><span class="o">:</span><span class="k">void</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">i</span><span class="p">,</span><span class="nx">a</span><span class="p">,</span><span class="nx">s</span><span class="p">;</span><span class="nx">a</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;link&#39;</span><span class="p">);</span><span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">i</span><span class="o">++</span><span class="p">){</span><span class="nx">s</span><span class="o">=</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span><span class="k">if</span><span class="p">(</span><span class="nx">s</span><span class="p">.</span><span class="nx">rel</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;stylesheet&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">&amp;&amp;</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">)</span><span class="o">%</span><span class="mi">20</span><span class="p">{</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">h</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/(&amp;|%5C?)forceReload=d+/</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">);</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="o">=</span><span class="nx">h</span><span class="o">+</span><span class="p">(</span><span class="nx">h</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">?</span><span class="s1">&#39;&amp;&#39;</span><span class="o">:</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">+</span><span class="s1">&#39;forceReload=&#39;</span><span class="o">+</span><span class="p">(</span><span class="k">new</span><span class="o">%</span><span class="mi">20</span><span class="nb">Date</span><span class="p">().</span><span class="nx">valueOf</span><span class="p">())}}})();</span> </span></pre></div> </td></tr></table>
bookmarklet, cache, css

JavaScript

Replace parts of current URL and go to it

javascript:(function() {var curloc = location.href; curloc = curloc.replace(/www/g,"cp");curloc = curloc.replace(/view/g,"edit"); location.href = curloc; })();
https://snipt.net/embed/a46bb815b13d7481c21ec93c46beae3c/
https://snipt.net/raw/a46bb815b13d7481c21ec93c46beae3c/
a46bb815b13d7481c21ec93c46beae3c
js
JavaScript
1
2016-12-01T16:39:08
True
False
False
/api/public/snipt/43196/
replace-parts-of-current-url-and-go-to-it
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">javascript</span><span class="o">:</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span><span class="kd">var</span> <span class="nx">curloc</span> <span class="o">=</span> <span class="nx">location</span><span class="p">.</span><span class="nx">href</span><span class="p">;</span> <span class="nx">curloc</span> <span class="o">=</span> <span class="nx">curloc</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/www/g</span><span class="p">,</span><span class="s2">&quot;cp&quot;</span><span class="p">);</span><span class="nx">curloc</span> <span class="o">=</span> <span class="nx">curloc</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/view/g</span><span class="p">,</span><span class="s2">&quot;edit&quot;</span><span class="p">);</span> <span class="nx">location</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="nx">curloc</span><span class="p">;</span> <span class="p">})();</span> </span></pre></div> </td></tr></table>
bookmarklet, javascript
Copyrighted, illegal, or inappropriate content? Email [email protected].