Archive

Archive for January, 2010

Resolve jQuery and MooTools Conflict

January 24th, 2010 10:30 am by John Dalesandro No comments

jQuery and MooTools are great JavaScript libraries for introducing dynamic interactions to your web site or application. They both include capabilities for manipulating CSS and adding various effects and animations as well as pre-built Ajax functions. However, if you need to use both on the same page then you’ll immediately have a conflict since they both use the same namespace by default. To avoid the conflict, jQuery includes the ability to modify its namespace using jQuery.noConflict(). If you call this method after loading the jQuery library, then all references to jQuery should use “jQuery” instead of “$.” This will allow MooTools to function using $. The particular issue I had was a conflict between jQuery, Thickbox and MooTools. Correcting this conflict required the additional step of changing all references to $ in the Thickbox library to jQuery. Thickbox includes some uses of $ that shouldn’t be replaced, so don’t do a global find and replace.

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  jQuery.noConflict();
</script>
Categories: Computing Tags: , ,

Preventing Referrer Spam

January 24th, 2010 9:30 am by John Dalesandro No comments

There is a plugin called Bad Behavior for WordPress that helps reduce referrer spam. As long as your log files are properly secured and not publicly available, then referrer spam isn’t much of a problem. However, if you’re like me and you don’t prefer links to nasty sites showing up in your StatPress dashboard, then Bad Behavior might be a plugin worth adding to your site. This site uses a combination of both Bad Behavior and WP-SpamFree which seems to catch almost all of the spam hits and comments. I don’t receive a lot of traffic so I can’t tell how this combination would work on a high volume site. As a minor warning, these plugins do seem to slow down response time just a bit.

Categories: Computing Tags: , ,