snipt

Ctrl+h for KB shortcuts

JavaScript

Save YouTube Video

javascript:if(document.location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){document.location.href='http://www.youtube.com/get_video?fmt=18&video_id='+swfArgs['video_id']+'&t='+swfArgs['t']}
https://snipt.net/embed/a2896701e19056292ae62506c6424978/
/raw/a2896701e19056292ae62506c6424978/
a2896701e19056292ae62506c6424978
js
JavaScript
1
2019-07-16T19:57:05
True
False
False
/api/public/snipt/1147/
save-youtube-video
<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">if</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/</span><span class="p">)){</span><span class="nb">document</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="s1">&#39;http://www.youtube.com/get_video?fmt=18&amp;video_id=&#39;</span><span class="o">+</span><span class="nx">swfArgs</span><span class="p">[</span><span class="s1">&#39;video_id&#39;</span><span class="p">]</span><span class="o">+</span><span class="s1">&#39;&amp;t=&#39;</span><span class="o">+</span><span class="nx">swfArgs</span><span class="p">[</span><span class="s1">&#39;t&#39;</span><span class="p">]}</span> </span></pre></div> </td></tr></table>
javascript, save, video, youtube

JavaScript

grab selected option from select element

$('#selectList').val();
https://snipt.net/embed/ab9f23364ec4895ead234c065ad7466f/
/raw/ab9f23364ec4895ead234c065ad7466f/
ab9f23364ec4895ead234c065ad7466f
js
JavaScript
1
2019-07-14T08:04:49
True
False
False
/api/public/snipt/46/
grab-selected-option-from-select-element
<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">$</span><span class="p">(</span><span class="s1">&#39;#selectList&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> </span></pre></div> </td></tr></table>
javascript, jquery