Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Check if images are loaded

1
2
3
$('img').load(function() {
	console.log('image load successful');
});
https://snipt.net/embed/0b8599f3aa0e7180e0640d69b8ad82db/
https://snipt.net/raw/0b8599f3aa0e7180e0640d69b8ad82db/
0b8599f3aa0e7180e0640d69b8ad82db
js
JavaScript
3
2016-12-03T20:36:28
True
False
False
/api/public/snipt/109798/
check-if-images-are-loaded
<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></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;img&#39;</span><span class="p">).</span><span class="nx">load</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;image load successful&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="p">});</span> </span></pre></div> </td></tr></table>
check, images, jquery, load

PHP

Load jQuery in your WP theme

<?php wp_enqueue_script("jquery"); ?>
https://snipt.net/embed/eab00bfdb2f285747ab8e25b1ec55b9c/
https://snipt.net/raw/eab00bfdb2f285747ab8e25b1ec55b9c/
eab00bfdb2f285747ab8e25b1ec55b9c
php
PHP
1
2016-12-05T06:46:33
True
False
False
/api/public/snipt/22398/
load-jquery-in-your-wp-theme
<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="cp">&lt;?php</span> <span class="nx">wp_enqueue_script</span><span class="p">(</span><span class="s2">&quot;jquery&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
jquery, load, themes, wordpress
Copyrighted, illegal, or inappropriate content? Email [email protected].