<?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>FrontEnd Archives - SideCode</title>
	<atom:link href="https://sidecode.io/dev-blog-category/frontend/feed/" rel="self" type="application/rss+xml" />
	<link>https://sidecode.io/dev-blog-category/frontend/</link>
	<description>Web Development &#38; IT Consulting Company</description>
	<lastBuildDate>Thu, 14 May 2020 09:17:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://sidecode.io/wp-content/uploads/logo_icon-150x150.png</url>
	<title>FrontEnd Archives - SideCode</title>
	<link>https://sidecode.io/dev-blog-category/frontend/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>JavaScript &#8211;  Getting URL Parameter and setting a URL parameter  (Snippet)</title>
		<link>https://sidecode.io/dev-blog/javascript-getting-url-parameter-and-setting-a-url-parameter-snippet/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Tue, 08 Nov 2016 10:15:44 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1160</guid>

					<description><![CDATA[<p># Getting a URL Parameter A function that you give it the param, (url params or url args, whatever you want to call it) to find from the current url (key), and she returns the value of that parameter. var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&#38;'), sParameterName, i; ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/javascript-getting-url-parameter-and-setting-a-url-parameter-snippet/">JavaScript &#8211;  Getting URL Parameter and setting a URL parameter  (Snippet)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3><a href="“#”"># </a>Getting a URL Parameter</h3>
<p>A function that you give it the param, (url params or url args, whatever you want to call it) to find from the current url (key), and she returns the value of that parameter.</p>
<pre>var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = decodeURIComponent(window.location.search.substring(1)),
        sURLVariables = sPageURL.split('&amp;'),
        sParameterName,
        i;

    for (i = 0; i &lt; sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : sParameterName[1];
        }
    }
};

  var area = getUrlParameter(‘area'); // get area value.
  if (typeof area == 'undefined') {
    // do something it exists!
  } else {
    // cry me a river
  }
</pre>
<h3><a href="“#”"># </a>Setting a URL Parameter (or changing it)</h3>
<p>Sometimes it is handy to change (or add ) a url parameter, from JavaScript</p>
<p>This function that you give it a : key (kuku) and a value (..value) and she updates the appropriate key, if dosen’t exists, she creates it.<br />
the function doesn’t touch other parameters (leave them like they were).</p>
<p>I used it in a situation where it was needed to check a parameter called “killme”<br />
if killme value was given to the function, she will delete the appropriate value.<br />
note: if killme sent when their is no such parameter, she creates it with this value.</p>
<pre>// added 'killme' value - to remove the query var alltogether. 
function setGetParameter(paramName, paramValue)
{
    var url = window.location.href;
    if (url.indexOf(paramName + "=") &gt;= 0)
    {
        var prefix = url.substring(0, url.indexOf(paramName));
        var suffix = url.substring(url.indexOf(paramName));
        suffix = suffix.substring(suffix.indexOf("=") + 1);
        suffix = (suffix.indexOf("&amp;") &gt;= 0) ? suffix.substring(suffix.indexOf("&amp;")) : "";
        if (paramValue == 'killme') {
        url = prefix + suffix;
        }
        else {
        url = prefix + paramName + "=" + paramValue + suffix;
        }
    }
    else
    {
    if (url.indexOf("?") &lt; 0)
        url += "?" + paramName + "=" + paramValue;
    else
        url += "&amp;" + paramName + "=" + paramValue;
    }
    window.location.href = url;
}
</pre>
<p>usage :</p>
<pre>  // Handles click
  jQuery( ‘.page-templat-page-something.area-widget li a' ).click(function( event ) {
    event.preventDefault(); 
   var href = jQuery(this).attr(‘href'); //get the a href
    if (typeof location != 'undefined' || href !='killme') { // check if location exists and if the value is not kill
	// .. killme request (because if kill and doesn’t exists -&gt;when try to kill error, this fix that)
      setGetParameter('area',href);
    }
});
</pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/javascript-getting-url-parameter-and-setting-a-url-parameter-snippet/">JavaScript &#8211;  Getting URL Parameter and setting a URL parameter  (Snippet)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>jQuery and General JavaScript Snippets</title>
		<link>https://sidecode.io/dev-blog/jquery-and-general-javascript-snippets/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Tue, 08 Nov 2016 10:05:08 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1157</guid>

					<description><![CDATA[<p>This will be a growing list of jQury, maybe even general JavaScript Snippets that I use a lot and always forget. # Add/Remove a class jQuery Add a class to a element jQuery(‘selector’).addClass(‘active’); Remove class from an element $( "p" ).removeClass( "myClass yourClass" ) # Find the html &#60;a&#62; Element with href that contain a ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/jquery-and-general-javascript-snippets/">jQuery and General JavaScript Snippets</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This will be a growing list of jQury, maybe even general JavaScript Snippets that I use a lot and always forget.</p>
<h3><a href="#"># </a>Add/Remove a class jQuery</h3>
<p>Add a class to a element</p>
<pre>jQuery(‘selector’).addClass(‘active’);</pre>
<pre>Remove class from an element</pre>
<pre>$( "p" ).removeClass( "myClass yourClass" )
</pre>
<h3><a href="“#”"># </a>Find the html <code>&lt;a&gt;</code> Element with href that contain a certain string</h3>
<p>Sometimes you need to find in your web page a anchor element with a specific string in it’s href<br />
this is example of find the a tag with href that contains “vc” var and adds a class to it’s<br />
parent element.</p>
<pre>jQuery('#menu-vendor-team-categories a[href*=“'+vc+'"]').parent().addClass('active');
</pre>
<p>Some of the selector stuff you can use, based on your needs:<br />
Selector documentation can be found at:</p>
<p>For Example:<br />
<code>=</code> &#8211; find a string that is exactly equal.<br />
<code>!=</code> &#8211; find a string that is not equal.<br />
<code>^=</code> &#8211; find a string that starts with.<br />
<code>$=</code> &#8211; find a string that ends with.<br />
<code>*=</code> &#8211; find a string that contains.<br />
<code>~=</code> &#8211; find a strings that contain this word.<br />
<code>|=</code> &#8211; find a string that starts with a prefix (<code>|=</code> “prefix” matches “prefix-…”).</p>
<h3><a href="#"># </a>Prevent Default</h3>
<p>General Javascript snippet.<br />
Stop the normal behavior of this element click event and do what i want.<br />
Can be applied with .on click &#8211; so that on click it will prevent default behavior and do as you please</p>
<pre> jQuery( ‘.#myElement' ).click(function( event ) {
    event.preventDefault();
    // do as you please here !
    }
});
</pre>
<h3><a href="“#”"># </a>Get Href of element (Guess it’s good for getting more things)</h3>
<p>href now contains the href string of this element. (if you got stupid or something):</p>
<pre>    
var href = jQuery(this).attr('href');
</pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/jquery-and-general-javascript-snippets/">jQuery and General JavaScript Snippets</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bootstrap Responsive Debugging &#8211;  CSS Media Queries Debugging</title>
		<link>https://sidecode.io/dev-blog/bootstrap-responsive-debugging-css-media-queries-debugging/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Wed, 02 Nov 2016 10:18:33 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1166</guid>

					<description><![CDATA[<p>Easy way to debug Responsive media breakpoints when you are using Bootstrap. If you are not using Bootstrap you can still adapt this method for Bootstrap debugging in your project, all you need to do is just write these classes to fit your grid system and breakpoints and you are good to go. Just ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/bootstrap-responsive-debugging-css-media-queries-debugging/">Bootstrap Responsive Debugging &#8211;  CSS Media Queries Debugging</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Easy way to debug Responsive media breakpoints when you are using Bootstrap.</p>
<p>If you are not using Bootstrap you can still adapt this method for Bootstrap debugging in your project, all you need to do is just write these classes to fit your grid system and breakpoints and you are good to go.</p>
<p>Just add these lines wherever you need to see what is the current media query, are you in XS,SM,LG,..</p>
<pre>&lt;div style="text-align:left; font-size: 16px; text-align:center; color:black;"&gt;
 &lt;span class="visible-xs"&gt;SIZE XS&lt;/span&gt;&lt;span class="visible-sm"&gt;SIZE SM&lt;/span&gt;&lt;span class="visible-md"&gt;SIZE MD&lt;/span&gt;&lt;span class="visible-lg"&gt;SIZE LG&lt;/span&gt; 
&lt;/div&gt;
</pre>
<p>These lines will spit up visibly on the web page the current size, so you will know when you are switching media query breakpoints.</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/bootstrap-responsive-debugging-css-media-queries-debugging/">Bootstrap Responsive Debugging &#8211;  CSS Media Queries Debugging</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>JavaScript &#8211; On Document Ready  (Snippet)</title>
		<link>https://sidecode.io/dev-blog/javascript-on-document-ready-snippet/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Sun, 08 May 2016 10:16:14 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1161</guid>

					<description><![CDATA[<p># JavaScript &#8211; On document ready (Snippet) Common use is let’s say you want to change color to an element to red, but when you run it you get a console error telling you that the element doesn’t exist, depending on your code structure, it is possible that this code is running before that ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/javascript-on-document-ready-snippet/">JavaScript &#8211; On Document Ready  (Snippet)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3><a href="#"># </a>JavaScript &#8211; On document ready (Snippet)</h3>
<p>Common use is let’s say you want to change color to an element to red, but when you run it you get a console error telling you that the element doesn’t exist, depending on your code structure, it is possible that this code is running before that element has even rendered and added to the document.<br />
So to prevent this you tell the browser to execute your code only after the document has been fully rendered and loaded.</p>
<p>Any JS code that is inside of this function will run only after the browser rendered and loaded the whole document.</p>
<pre>jQuery(document).ready(function(){
  // do stuff after document is ready.
});
</pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/javascript-on-document-ready-snippet/">JavaScript &#8211; On Document Ready  (Snippet)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 0/141 objects using disk
Page Caching using disk: enhanced 
Database Caching 4/72 queries in 0.055 seconds using disk

Served from: sidecode.io @ 2026-06-23 23:16:52 by W3 Total Cache
-->