SUBBUINDESIGN Blog

Basics of Google Font API (Application Program Interface)

Link to CSS files You essentially hotlink directly to CSS files on Google.com. Through URL parameters, you specificity which fonts you want, and what variations of those fonts. <head> <link rel=”stylesheet” type=”text/css” href=”http://fonts.googleapis.com/css?family=Tangerine:bold,bolditalic|Inconsolata:italic|Droid+Sans”> </head>...

How to avoid Java Code in JSP-Files?

The use of scriptlets (those <% %> things) in JSP is indeed highly discouraged since the birth of taglibs (like JSTL) and EL (Expression Language, those ${} things) over a decade ago. The major disadvantages of scriptlets are: Reusability: you can’t reuse scriptlets. Replaceability: you can’t make...

Simple Auto-Playing Slideshow using CSS3

HTML Wrapper with div’s as the “slides”, which can contain any content. <div id=”slideshow”> <div> <img src=”http://farm6.static.flickr.com/5224/5658667829_2bb7d42a9c_m.jpg”> </div> <div> <img src=”http://farm6.static.flickr.com/5230/5638093881_a791e4f819_m.jpg”> </div> <div> Pretty cool eh? This slide is proof the content can be...

Protecting Your Phone from Malware

While not all that common today, malware on phones is increasing, and you should get to know what puts your security at risk. Dealing with a virus or malware has long been accepted as...

How can i solve this php errorr“Notice: Undefined variable”?

Relying on the default value of an uninitialized variable is problematic in the case of including one file into another which uses the same variable name. It is also a major security risk with register_globalsturned on. E_NOTICE level error...

How can I get query string values?

You don’t need jQuery for that purpose. You can use the pure JavaScript: function getParameterByName(name) { name = name.replace(/[\[]/, “\\\[“).replace(/[\]]/, “\\\]”); var regexS = “[\\?&]” + name + “=([^&#]*)”; var regex = new RegExp(regexS);...

How to prevent SQL injection in PHP?

Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious...

How make Accessibility/SEO Friendly CSS Hiding code?

#content { position: absolute; top: -9999px; left: -9999px; } Removes an item from the page, without affecting page flow or causing scrollbars. Much better than display: none; or even visibility: hidden;  

How to Empty an Array using jQuery?

This is one of the fastest and easiest ways of emptying an array. Of course there are may other ways, but those usually include creation of a new array. This way you reuse the...

How to Turn on WordPress Error Reporting

Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don’t do this live, do it for local development and testing....

Different Stylesheet Pending the Time of Day

<script> <!– function getStylesheet() { var currentTime = new Date().getHours(); if (0 <= currentTime&&currentTime < 5) { document.write(“<link rel=’stylesheet’ href=’night.css’ type=’text/css’>”); } if (5 <= currentTime&&currentTime < 11) { document.write(“<link rel=’stylesheet’ href=’morning.css’ type=’text/css’>”); }...

How get Year Shortcode for a wordpress website?

For the functions.php file: function year_shortcode() { $year = date(‘Y’); return $year; } add_shortcode(‘year’, ‘year_shortcode’); Usage Use [year] in your posts.

HTML Radio Buttons using PHP coding

A Radio Button is a way to restrict users to having only one choice. Examples are : Male/Female, Yes/No, or answers to surveys and quizzes. Here’s a simple from with just two radio buttons...

What are the important CSS Rules

A Cascading Stylesheet rule tells the browser what the HTML looks like, and what it should do. A rule can dictate what just one HTML tag should look like, or you can construct your own...

How to create Dropdown Lists using jquery

The code to check the dropdown list is more or less the same as for radio buttons. Here it is: The only difference is in the IF Statement. Between the round brackets we have...

What is PHP?

PHP is probably the most popular scripting language on the web. It is used to enhance web pages. With PHP, you can do things like create username and password login pages, check details from...

Getting ready to change Facebook News Feed

NEW YORK (AP) — Amid chatter of “Facebook fatigue,” real or imagined, the world’s biggest social networking company is getting ready to unveil a new version of News Feed, the flow of status updates,...

How to create forms using PHP program

One of the main features in PHP is the ability to take user input and generate subsequent pages based on the input. In this page, we will introduce the mechanism by which data is...

How to Create a Flexible Folded Paper Effect With CSS3

In this tutorial we’ll learn to create a flexible (responsive) folded paper effect using CSS3 features like background gradients and box-shadows, which can give a cool-looking background to the content area of your website....

What is Responsive Design and Server Side Components?

There’s no shortage of debate about the best way to develop Web sites that work well across many networked devices. Some teams favor a client-side approach while others lean towards server-side solutions. But I’m increasingly...

How mix Responsive Design and Mobile Templates

You need a mobile strategy for your site. You have to pick Responsive Design or a dedicated mobile site, right? Maybe not. Maybe you can mix and match a variety of strategies.   Me...

How to make Smooth Scrolling using jquery

Performs a smooth page scroll to an anchor on the same page. $(document).ready(function() { function filterPath(string) { return string .replace(/^\//,”) .replace(/(index|default).[a-zA-Z]{3,4}$/,”) .replace(/\/$/,”); } var locationPath = filterPath(location.pathname); var scrollElem = scrollableElement(‘html’, ‘body’); $(‘a[href*=#]’).each(function() {...