jquery validator addmethod custom message

June 3, 2014

Custome message can be added in the validator addMethod, example below, the $.validator.messages.currency_limit carry the different message for different condition.

Checking if an array key exists in a JavaScript object or array

June 3, 2014

For the sake of completeness, you can use the in operator. This is probably the best way to check for missing keys.

jQuery set element style to the :hover css style

June 3, 2014

jQuery has .hover function which will freeze the hover effect. It’d be better to just give that state another class itself in the CSS and then use your method to add that class. You may keep the id of the div and control the css changes using class

jQuery how to know if div with specific id exists

June 3, 2014

To check if the div with specific id or class exist, you can use .length after the selector to see if it matched any elements, like this:

jQuery get parameter of url after #hash tags

May 21, 2014

For url that is also document’s location, use below code to find if #hash tag exist To get the url parameters, simply use code like

jquery change css background image

May 20, 2014

There is two ways of achieve the css set background image using jquery. First: Second: The first method can set multiple css at one time. While the second method only one css per time.

phpMyadmin can’t set default value to Null

May 20, 2014

Newer version of phpmyadmin, some user might experience to get error when trying to set a field to NULL. To make this work, make sure that the option Null for the column be checked. Scroll to the right to find Null column.

PHP cURL POST follow location

May 20, 2014

Using cURL to get the last URL address of POSTED is simply add this line to the cURL request: To know the last url from post request, after curl_exec, add this line: Full sxample:

PHP check remote image valid using curl without download content

May 20, 2014

Using curl, without download content, remote image valid can be known. Example: Output: false

PHP initialize objects like arrays

May 20, 2014

In PHP, you can initialize arrays with values quickly using the following notation: To initialize objects, use STDClass To quickly initialize objects like arrays, we can do: