<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jQuery Tips Archives - Ideas and Pixels</title>
	<atom:link href="https://www.ideasandpixels.com/articles/category/programming-tips/jquery-tips/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.ideasandpixels.com/articles/category/programming-tips/jquery-tips/</link>
	<description>The Best Cincinnati Web Design Agency</description>
	<lastBuildDate>Tue, 01 Mar 2016 17:11:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Google Maps API &#8211; Invalid Key Or Referrer Fix</title>
		<link>https://www.ideasandpixels.com/articles/google-maps-api-invalid-key-or-referrer-fix/</link>
					<comments>https://www.ideasandpixels.com/articles/google-maps-api-invalid-key-or-referrer-fix/#respond</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Mon, 27 Jul 2015 22:28:38 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=2277</guid>

					<description><![CDATA[<p>The Google Maps API should be easy to use, and it really is. What&#8217;s not easy is figuring out what&#8217;s wrong when it&#8217;s throwing the following error: Invalid Key or...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/google-maps-api-invalid-key-or-referrer-fix/">Google Maps API &#8211; Invalid Key Or Referrer Fix</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The Google Maps API <em>should</em> be easy to use, and it really is. What&#8217;s not easy is figuring out what&#8217;s wrong when it&#8217;s throwing the following error: <strong>Invalid Key or Referrer.</strong></p>
<p>One would think that the answer is obvious: you either have an invalid key or you&#8217;ve specified an incorrect referrer. But as with most generalized error messages, neither one is the answer. Google&#8217;s policy for their Google Maps API is that they don&#8217;t require a token or public key if you&#8217;re not using Maps for business purposes (which is only used when you exceed their daily quotas). If you don&#8217;t have your credit card details saved in the API console and you try to use a public key for your Javascript Maps call, it returns &#8220;invalid key&#8221;. Google forgot to tell us this important detail.</p>
<p>To fix this problem, simple remove your key from the API call. Simply using this will do:</p>
<pre><code class="language-javascript">&lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false"&gt;&lt;/script&gt;</code></pre>
<p>Yes, it&#8217;s that mind-numbingly simple to fix. As is life.</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/google-maps-api-invalid-key-or-referrer-fix/">Google Maps API &#8211; Invalid Key Or Referrer Fix</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/google-maps-api-invalid-key-or-referrer-fix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Skrollr Can&#8217;t Scroll On Mobile Devices</title>
		<link>https://www.ideasandpixels.com/articles/skrollr-cant-scroll-on-mobile-devices/</link>
					<comments>https://www.ideasandpixels.com/articles/skrollr-cant-scroll-on-mobile-devices/#comments</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Fri, 30 May 2014 23:42:04 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=2149</guid>

					<description><![CDATA[<p>So you just found Skrollr for jQuery, started using it, and discovered your website won&#8217;t scroll on any mobile devices like the iPhone or Android. You just can&#8217;t figure out...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/skrollr-cant-scroll-on-mobile-devices/">Skrollr Can&#8217;t Scroll On Mobile Devices</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>So you just found Skrollr for jQuery, started using it, and discovered your website won&#8217;t scroll on any mobile devices like the iPhone or Android. You just can&#8217;t figure out why. Well here&#8217;s the solution &mdash; try not to beat yourself up about how easy and simple it is.</p>
<p>The README file states the following: <strong>Starting with skrollr 0.6.0 there&#8217;s just one thing you need to do: Include an element on your page with the id skrollr-body.</strong></p>
<p>Yes, that&#8217;s it. Add id=&#8221;skrollr-body&#8221; to your body element and scrolling is back.</p>
<p>Thank me later&#8230; or in the comments. 🙂</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/skrollr-cant-scroll-on-mobile-devices/">Skrollr Can&#8217;t Scroll On Mobile Devices</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/skrollr-cant-scroll-on-mobile-devices/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>WP_Enqueue_Script Inline Script To Load After jQuery</title>
		<link>https://www.ideasandpixels.com/articles/wp_enqueue_script-inline-script-to-load-after-jquery/</link>
					<comments>https://www.ideasandpixels.com/articles/wp_enqueue_script-inline-script-to-load-after-jquery/#comments</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Mon, 07 Oct 2013 00:50:51 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<category><![CDATA[WordPress Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=1910</guid>

					<description><![CDATA[<p>The WordPress Codex doesn&#8217;t seem to have an answer for how to enqueue an inline script so that it can load with all the right dependencies &#8212; principally jQuery in...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/wp_enqueue_script-inline-script-to-load-after-jquery/">WP_Enqueue_Script Inline Script To Load After jQuery</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The WordPress Codex doesn&#8217;t seem to have an answer for how to enqueue an inline script so that it can load with all the right dependencies &#8212; principally jQuery in most cases. Luckily, with some quick thinking, we can hook into the enqueue action and achieve this ourselves fairly easily.</p>
<h2>Load Inline Script After jQuery WP Enqueue Script in WordPress</h2>
<pre class="prettyprint">
&lt;?php
function print_my_inline_script() {
  if ( wp_script_is( 'jquery', 'done' ) ) {
?&gt;
&lt;script type="text/javascript"&gt;
// js code goes here
&lt;/script&gt;
&lt;?php
  }
}
add_action( 'wp_footer', 'print_my_inline_script' );
?&gt;
</pre>
<p>All we are doing is surrounding the inline script with a PHP function that hooks into the wp_footer action to fire only after jQuery has been loaded, along with the DOM.</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/wp_enqueue_script-inline-script-to-load-after-jquery/">WP_Enqueue_Script Inline Script To Load After jQuery</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/wp_enqueue_script-inline-script-to-load-after-jquery/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>How To Get $_GET and $_POST Variables In Javascript</title>
		<link>https://www.ideasandpixels.com/articles/get-post-variables-with-javascript/</link>
					<comments>https://www.ideasandpixels.com/articles/get-post-variables-with-javascript/#comments</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Fri, 30 Aug 2013 23:18:16 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=1824</guid>

					<description><![CDATA[<p>Retrieving the GET and POST superglobal headers in Javascript is actually very easy, although most of us are spoiled by the method used by PHP ($_GET and $_POST). Although it...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/get-post-variables-with-javascript/">How To Get $_GET and $_POST Variables In Javascript</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Retrieving the GET and POST superglobal headers in Javascript is actually very easy, although most of us are spoiled by the method used by PHP ($_GET and $_POST).</p>
<p>Although it takes a few more lines of code, you can mimic PHP.</p>
<h2>How To Get $_GET in Javascript</h2>
<pre class="prettyprint">var $_GET = {};

document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
    function decode(s) {
        return decodeURIComponent(s.split("+").join(" "));
    }

    $_GET[decode(arguments[1])] = decode(arguments[2]);
});</pre>
<p>You can now access the $_GET variables like so:</p>
<pre class="prettyprint">alert($_GET['some_variable']);</pre>
<h2>How To Get $_POST in Javascript</h2>
<p>$_POST is handled a little differently (with the help of PHP). This cross-language fix allows you to store the PHP superglobal $_POST into a Javascript variable. You can also use this method for $_GET.</p>
<pre class="prettyprint">
&lt;script&gt;
var $_POST = <?php echo json_encode($_POST); ?>;

document.write($_POST["test"]);
&lt;/script&gt;
</pre>
<p>Happy coding!</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/get-post-variables-with-javascript/">How To Get $_GET and $_POST Variables In Javascript</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/get-post-variables-with-javascript/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>BlockUI Requires jQuery v1.3 Or Later! Quick Fix</title>
		<link>https://www.ideasandpixels.com/articles/blockui-requires-jquery-v1-3-or-later-quick-fix/</link>
					<comments>https://www.ideasandpixels.com/articles/blockui-requires-jquery-v1-3-or-later-quick-fix/#comments</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Sat, 25 May 2013 08:44:05 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=1658</guid>

					<description><![CDATA[<p>Many developers are reporting the following alert box message on their websites that use blockUI and jQuery: blockUI requires jQuery v1.3 or later! You are using v1.10.0. Fortunately, the solution...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/blockui-requires-jquery-v1-3-or-later-quick-fix/">BlockUI Requires jQuery v1.3 Or Later! Quick Fix</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Many developers are reporting the following alert box message on their websites that use blockUI and jQuery:</p>
<blockquote>
<p>blockUI requires jQuery v1.3 or later! You are using v1.10.0.</p>
</blockquote>
<p>Fortunately, the solution is very simple, but it requires some out of the box thinking. What confused us was that we didn&#8217;t actually call the blockUI script at all on any of our websites, but we were still getting the message. It instantly clicked that this was some sort of dependency issue.</p>
<h2>How To Fix BlockUI Requires jQuery v1.3 Or Later Message</h2>
<p>Last night jQuery rolled out an update to its jQuery &#8220;latest&#8221; link, updating it to push out jQuery version 1.10.0. The problem is that the blockUI script cannot read the trailing zeros on this version, so it reads it as <em>1.1</em>, which of course is a very dated version of jQuery. To fix this, we must remove our jQuery latest script and instead replace it with either a local copy of jQuery or the following Google Library version (we&#8217;re using 1.9.1 in this instance):</p>
<pre class="prettyprint">&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;
&lt;/script&gt;</pre>
<p>That should correct the problem! Let us know in the comments section if you have any additional solutions.</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/blockui-requires-jquery-v1-3-or-later-quick-fix/">BlockUI Requires jQuery v1.3 Or Later! Quick Fix</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/blockui-requires-jquery-v1-3-or-later-quick-fix/feed/</wfw:commentRss>
			<slash:comments>27</slash:comments>
		
		
			</item>
		<item>
		<title>Using jQuery To Check If Element Has Siblings</title>
		<link>https://www.ideasandpixels.com/articles/using-jquery-to-check-if-element-has-siblings/</link>
					<comments>https://www.ideasandpixels.com/articles/using-jquery-to-check-if-element-has-siblings/#respond</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Fri, 03 May 2013 13:56:40 +0000</pubDate>
				<category><![CDATA[Design Tips]]></category>
		<category><![CDATA[jQuery Tips]]></category>
		<category><![CDATA[Programming Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=1455</guid>

					<description><![CDATA[<p>If you&#8217;ve used jQuery before, chances are you&#8217;ve also used the .siblings() selector method. Selecting siblings of elements comes in handy in many applications, but what if instead of selecting...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/using-jquery-to-check-if-element-has-siblings/">Using jQuery To Check If Element Has Siblings</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve used jQuery before, chances are you&#8217;ve also used the <code>.siblings()</code> selector method. Selecting siblings of elements comes in handy in many applications, but what if instead of selecting siblings, you just wanted to count them?</p>
<h2>Counting Siblings With jQuery</h2>
<p>Counting the number of siblings an element has with jQuery is incredibly simple.</p>
<p><code class="prettyprint">$("#someElementId").siblings().size()</code></p>
<p>We can also use an &#8220;if&#8221; statement to check if the element has any siblings at all.</p>
<p><code class="prettyprint">if ($("#someElementId").siblings().size() &gt; 0) { // then it has siblings } else { // it doesn't }</code></p>
<p>.size() doesn&#8217;t just work with the siblings selector, so interchange .siblings() with any of the other selectors jQuery offers.</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/using-jquery-to-check-if-element-has-siblings/">Using jQuery To Check If Element Has Siblings</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/using-jquery-to-check-if-element-has-siblings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Best New Old Thing: jQuery Masonry Plugin</title>
		<link>https://www.ideasandpixels.com/articles/thing-jquery-masonry-plugin/</link>
					<comments>https://www.ideasandpixels.com/articles/thing-jquery-masonry-plugin/#respond</comments>
		
		<dc:creator><![CDATA[Allen Gingrich]]></dc:creator>
		<pubDate>Thu, 19 Jan 2012 02:24:50 +0000</pubDate>
				<category><![CDATA[jQuery Tips]]></category>
		<guid isPermaLink="false">http://ideasandpixels.com/?p=339</guid>

					<description><![CDATA[<p>Every designer has come across a itemized design that called for precipitous &#8220;blocking&#8221; of elements at least once in their lives. Much like the front page of this blog, for...</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/thing-jquery-masonry-plugin/">The Best New Old Thing: jQuery Masonry Plugin</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://ideasandpixels.com/wp-content/uploads/2012/01/masonry_full.jpg"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-342" title="jQuery Masonry" alt="jQuery Masonry" src="http://ideasandpixels.com/wp-content/uploads/2012/01/masonry_full.jpg" width="520" height="321" srcset="https://www.ideasandpixels.com/wp-content/uploads/2012/01/masonry_full.jpg 520w, https://www.ideasandpixels.com/wp-content/uploads/2012/01/masonry_full-300x185.jpg 300w" sizes="(max-width: 520px) 100vw, 520px" /></a></p>
<p>Every designer has come across a itemized design that called for precipitous &#8220;blocking&#8221; of elements at least once in their lives. Much like the front page of this blog, for instance. And most have found that unless you specify an exact height for each block item, the entire design will fall to shambles once you load the page — not to mention it looks terrible as the default browser engine tries to assemble them together, usually failing miserably. Luckily for us, the folks over at <a href="http://masonry.desandro.com/docs/intro.html" target="_blank" rel="nofollow">Desandro</a> created a wonderfull jQuery plugin, &#8220;Masonry&#8221;.</p>
<p>Masonry intercepts the job of the browser to float the object, using it&#8217;s own mechanics to position elements both horizontally and vertically. Think Tetris, only for your website.</p>
<blockquote><p>Whereas floating arranges elements horizontally then vertically, Masonry arranges elements vertically, positioning each element in the next open spot in the grid.</p></blockquote>
<p>To use jQuery Masonry, download the script <a href="http://masonry.desandro.com/jquery.masonry.min.js" target="_blank" rel="nofollow">here</a>.</p>
<p>1) Place the following text inside your HEAD tag: <code class="prettyprint">&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="/path/to/jquery.masonry.min.js"&gt;&lt;/script&gt;</code> 2) Next, set all of your items that you want to be masoned to &#8216;float&#8217;.</p>
<p>3) Place the following code into your HEAD tag, adjusting the selector as you wish: <code class="prettyprint">$(function(){ $('#container').masonry({ // options itemSelector : '.item', columnWidth : 240 }); });</code></p>
<p>Voila! Your items should now start blocking up until the page is full.</p>
<p>You can adjust the many parameters of this function by referencing the <a href="http://masonry.desandro.com/docs/options.html" target="_blank" rel="nofollow">Masonry Reference</a>.</p>
<p>The post <a href="https://www.ideasandpixels.com/articles/thing-jquery-masonry-plugin/">The Best New Old Thing: jQuery Masonry Plugin</a> appeared first on <a href="https://www.ideasandpixels.com">Ideas and Pixels</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.ideasandpixels.com/articles/thing-jquery-masonry-plugin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
