jQuery call same on click function of elements having same ids
February 17, 2014
You cannot have multiple ID’s in your HTML markup. It would be an invalid markup. When querying for $(‘#foobar’) and there are five elements which have that id, you would only get the first instance. So even if there would be a way (…) to apply code to all of those nodes, don’t do it. […]
jquery get the parent element’s id
February 17, 2014
You could use event delegation on the parent div. Or use the closest method to find the parent of the button. The easiest of the two is probably the closest.
PHP convert an object to an array
February 13, 2014
For single dimensional array (array) $object works fine. Multi dimension object to array consist of private and protected members. Example single dimensional: All objects to converted to associative arrays: Reference from here
PHP check whether image exists on remote URL
February 12, 2014
The simplest and fastest way is to use curl if your host supports curl.
PHP check if a url is valid using filter_var
February 12, 2014
URL can simply validate use FILTER_VALIDATE_URL in filter_var(). For example: IT can be in a function:
PHP – How to check if variable is an array?
February 12, 2014
PHP has an internal variables handling functions to finds whether a variables is an array Another fastest way of determining an array is by: Cast the value to an array, then check using (===) if it is identical to the original.
MySql query ORDER BY two columns
January 24, 2014
You can order by multiple columns in mysql. The first order take first preference and then second one get next preference in mysql. Example: Statement lik: will sort both columns descending. If specified each column ASC or DESC, first order will take first preference and then second one get next preference in mysql
jquery add overlay layer to a div or body
January 21, 2014
First create the css properties for the overlay layer:
PHP obfuscated or hide part of the email address
January 17, 2014
I wrote my own function for one of the project to display first 3 characters and last characters before the @. In between the first and last 3 characters, put in 3 star (*). So, this is how it looks like
jQuery datePicker enable select past dates
January 14, 2014
How to enable the past dates of jQuery inline datePicker? You need to make sure that the minDate option is null. example: Full example:
Recent Comments