Tips & Tricks Tutorials

How to Open Links in a Popup Window

Popup windows are not always desirable but there may be a genuine need for opening links in a popup window in web applications. In this post, I will show how to open link in a popup window. Open Link in a Popup Window Normally links get opened in the same window in which they are clicked in. To open them in a new window, we add target=”_blank” attribute to links. …

Continue reading

Ping the Sitemap to Search Engines after update the Site

It is advisable that you submit the updated sitemap to the search engines like Google & Bing to tell them about the updated content, when you publish a new post, or make changes to your site structure which updates the sitemap of your website. In this post, I will show how to ping the sitemap to Search Engines after update the site manually. If you are running a WordPress site …

Continue reading

Prevent scrolling on body in iOS

When we develop a web page for mobile and we are creating a drawer to hold the content that will scroll separately, we can use overflow: hidden; on the body tag is sufficient to prevent scrolling a web page. However, this doesn’t work in iOS6. I have found a best solution for this to set position: fixed.

Sort an Array Alphabetically in Javascript

To Sort an Array Alphabetically, we have a sort() method in JavaScript arrays that sorts the array items into an alphabetical order. The sort() method accepts an optional argument as a function that compares two elements of the array. Following is the syntax of the sort() method: If we leave the compare function, then the sort() method will sort the array based on the array values. Following are the rules …

Continue reading

How to improve web page speed in Mobile

There are several benefits of website page speed optimization. Fast sites rank better in search engines. Google has specifically stated that one of their ranking factors is site performance, especially for mobile users. Speed optimization reduces server load. A fast website increases conversions. Fast page loads make happy customers, and happy customers buy more. To improve page speed in mobile, please follow below very easy steps before make website live. …

Continue reading

How to Get the Length of an Object in JavaScript

Everything in JavaScript is an Object. You can simply use the Object constructor in JavaScript to create an object or you can define a string object, an array object and add properties and values to it. Sometimes we require to know the length of an object for any specific reason, there is a simplest and quickest way to get the length of a given object in JavaScript is by using …

Continue reading

How to get the Widget ID in WordPress

If you are customizing the WordPress theme or working on your own theme, you might need a widget ID to make everything work like you want. For example, if you want to hide the widget on a specific page, you will need to provide a widget ID to make the code work. In this tutorial, we will show you how to get the widget ID in WordPress. Get the widget …

Continue reading

How to Remove Special Character from String in PHP

In this tutorial I will show you how to remove special character from string in PHP. Sometimes we need to remove all special characters by using preg_replace from input string. There are two option available to remove special character from string using php. Option 1: Using preg_replace PHP Function We can remove special character from sting using preg_replace, it’s using regular expression to special character from string. Syntax of preg_replace …

Continue reading