Latest Tutorial

string to url slug convert in phpstring to url slug convert in php

Function: function create_slug($string, $ext='.html'){     $replace = '-';       $string = strtolower($string);     //remove query string     if(preg_match("#^http(s)?://[a-z0-9-_.]+\.[a-z]{2,4}#i",$string)){         $parsed_url = parse_url($string);         $string = $parsed_url['host'].' '.$pars…

Read more »
23Dec2013

Javascript Using the document.getElementsByName MethodJavascript Using the document.getElementsByName Method

This method takes in as argument the name attribute value of elements to be retrieved and returns a collection of desired matching elements. In the code snippet below, let us say we need to get a reference to the element with the name attribute mail_format. select name="mail_format" id="slt_mail_f…

Read more »
19Nov2013

Javascript Other Cross-browser ways of accessing form element objectsJavascript Other Cross-browser ways of accessing form element objects

There are two other cross-browser ways of accessing form elements: document.getElementsByTagName anddocument.getElementsByName. USING THE DOCUMENT.GETELEMENTSBYTAGNAME METHOD This method takes in as argument the name of a tag (element) and returns an array of all matching tags (elements) found in t…

Read more »
19Nov2013

Javascript Checking for getElementById supportJavascript Checking for getElementById support

All modern browsers support getElementById() method. However if you are to support very old browsers, use the following function: function getElement (id) { if (document.getElementById) { return document.getElementById(id); } else if (document.all) { return window.document.all[id]; } else if (docum…

Read more »
19Nov2013

Javascript access and validation the form and input elementsJavascript access and validation the form and input elements

Demo: Using getElementById to get the elements in a form Subscribe to our Newsletter! Please enter your subscription information: Your Name: Your Email: Mail Format: Plain Text HTML No, Thank you! Some other time, perhaps.... Example demo1.js function trim(str) { return str.replace(/^\s+|\s+$/g,…

Read more »
19Nov2013

Accessing Form Elements using getElementByIdAccessing Form Elements using getElementById

In order to access the form element, we can use the method getElementById() like this: var name_element = document.getElementById('txt_name'); The getElementById() call returns the input element object with ID ‘txt_name’ . Once we have the object, we can get the properties and call the methods of t…

Read more »
19Nov2013

Use getElementById to get the elements in a formUse getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById() method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and…

Read more »
19Nov2013

JavaScript Date and Time ObjectJavaScript Date and Time Object

The Date object is useful when you want to display a date or use a timestamp in some sort of calculation. In Java, you can either make a Date object by supplying the date of your choice, or you can let JavaScript create a Date object based on your visitor’s system clock. It is usually best to let J…

Read more »
19Nov2013

JavaScript PopupsJavaScript Popups

However, we will show you how to make windows popup for reasonable occasions, like when you want to display extra information, or when you want to have something open a new window that isn’t an HTML anchor tag (i.e. a hyperlink). JavaScript window.open Function The window.open() function creates a …

Read more »
19Nov2013

JavaScript Time DelayJavaScript Time Delay

Implementing a timed delay in JavaScript is useful in the following situations: Showing an “Update your bookmark” page when you have to change URLs or page locations For download sites that wish to have a timed delay before the download starts To refresh a webpage once every specified number of sec…

Read more »
19Nov2013

JavaScript Window.LocationJavaScript Window.Location

Control over what page is loaded into the browser rests in the JavaScript property window.location. By setting window.location equal to a new URL, you will in turn change the current webpage to the one that is specified. If you wanted to redirect all your visitors to www.google.com when they arrive…

Read more »
19Nov2013

JavaScript Print FunctionJavaScript Print Function

The JavaScript print function performs the same operation as the print option that you see at the top of your browser window or in your browser’s “File” menu. The JavaScript print function will send the contents of the webpage to the user’s printer. JavaScript Print Script – window.print() The Java…

Read more »
19Nov2013

JavaScript Alert Prompt and Confirm functionJavaScript Alert Prompt and Confirm function

JAVASCRIPT ALERT EXAMPLE 1: Using alert Boxes Using alert Boxes Prompt JavaScript Confirm function   1 A Simple Page Confirm function A Simple Page

Read more »
19Nov2013

JavaScript ArrayJavaScript Array

Array Constructors: var variable = new Array()var variable = new Array(int)var variable = new Array(arg1, ..., argN) These constructors create a new array and initialize the Array object based on the arguments passed in the parameter list. The constructor that has no arguments sets the length prope…

Read more »
19Nov2013
123 ... 10»
 
Top
Blogger Template