Menu
Home
Recent Posts
"exists" function in jQuery
7:43 AM
0
Share
For verify the existence of an element in jQuery this is the piece of code:
jQuery
.
fn
.
exists
=
function
(){
return
this
.
length
>
0
;}
if
(
$
(
selector
).
exists
())
{
// Do something
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Development and programming answers
Search articles
Popular Posts
How to solve: Notice: Array to string conversion
This simply happens if you try to treat an array as a string: $arr = array ( 'foo' , 'bar' ); echo $arr ; // Notice:...
How to solve: Fatal error: Call to a member function ... on a non-object
This happens with code similar to xyz->method() where xyz is not an object and therefore that method can not be called. This ...
How to: Insert 'if not exists' in MySQL without query previously from PHP
use INSERT IGNORE INTO table see http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html there's also INSERT … ON D...
How to return the response from an AJAX call
function foo() { var result; $.ajax({ url: '...', success: function (response) { result = res...
How to: Transact MySQL and PHP
The idea I generally use when working with transactions looks like this (semi-pseudo-code): try { // First of all, let's begin a...
No comments:
Post a Comment