Home > Features > Try Getting Out of a Bind by Going Live • Bookmark   • Newsletters   • Register Search Options

FEATURE

Try Getting Out of a Bind by Going Live

Try Getting Out of a Bind by Going Live

October 1, 2011
Text size: 
View in Digital Mag
Get XBIZ News
XBIZ Research
Will virtual reality boost the paysite market?
Yes, it will soon
  39.66%
Yes, but in a few years
  36.87%
No
  23.46%
Out of 179 votes. Results based on votes submitted by members of XBIZ.net social network.

" One of its biggest benefits, however, is that .live() supports event delegation such as may be found in dynamic web environments. "

An alternative way to code event handling in jQuery (.live instead of .bind) may offer benefits for certain applications.

Bind (api.jquery.com/bind/) is a means of attaching an event handler to an element. The command has an antithesis, .unbind(), which will remove a previously attached event handler from a specified element. Together, these commands allow jQuery to automate and alter actions in response to events such as a click or mouse over; for an easy example:

$('#test').bind('click', function() {
alert('You clicked on the element "test"');
});

The code above binds the click event to an element, such as a div, with an ID of “test” — clicking on that element will now launch an alert dialog box in response. Using jQuery also allows shortcuts for binding standard event types, such as enabling the use of .click() in place of .bind('click').

Multiple .bind() events can be scripted and their handlers readily manipulated, making this an efficient technique for accomplishing a wide range of tasks.

But is it always the best choice?

Live (api.jquery.com/live/), a variation of .bind(), offers an alternative method for attaching event handlers to specified elements.

According to jQuery.com, “When .bind() is called, the elements that the jQuery object refers to get the handler attached; elements that get introduced later do not, so they would require another .bind() call.”

Live mitigates this need.

Like .bind(), the .live() command has an antithesis, .die(), which removes previously attached event handlers from their assigned element.

One of its biggest benefits, however, is that .live() supports event delegation such as may be found in dynamic web environments.


EDUCATIONAL FEATURES

E-Stim Basics: Selling Customers on Powerboxes as Pleasure Tools

Electrosex is a commonly misunderstood pleasure practice for good reason: Most of us have negative associations with electricity; maybe we’ve been shocked after rubbing our feet across a carpeted... More »

Search Oftentimes Is Left to Chance

Adult content is frowned upon in search, whether in paid, organic or social. With the big algo updates from the past few years, Google has cleaned up search, trying to get rid of spammy and low-quality... More »

Five Tips to Generate Repeat Business

A $50 sale is great. But what if you could get that same $50 sale to come back four times in the next few months? Here are some ideas how to achieve that. 1) On your receipts, you should have an option... More »
XBIZ NEWSLETTERS
Stay informed of the latest industry developments. Get XBIZ newsletters delivered to your inbox. Subscribe today!
Enter email address:

* To manage existing subscriptions click here.






POPULAR PRODUCTS & SERVICES
Submit your press release to
multiple news outlets with 1 click.
Subscribe to RSS news feeds or
add free content to your website.
Access XBIZ news and articles
with your mobile device.
Subscribe to XBIZ Premiere magazine, the industry's leading adult retail trade publications, delivering the most timely and comprehensive business news and information to producers and retailers of adult products.

UPCOMING EVENTS

Everything To Do With Sex Show

Jan 27 - Jan 29
Halifax, Nova Scotia

The European Summit

Mar 04 - Mar 07
Barcelona-Sitges, Spain

The TEA Show

Mar 05 - Mar 06
Hollywood, CA

Phoenix Forum 2017

Mar 23 - Mar 26
Tempe, Arizona
Everyday thousands of business professionals browse XBIZ's industry directory for quality products and services. Not listed yet? Your company could be losing potential new business. Submit your company today!
Use XBIZ RSS feeds to stay informed of the latest industry developments or as a content syndication tool for your website!