, Prototype, . script js/prototype.js script js/drop-o-matic.js.
(Chrome Dev Tools, Firebug Firefox, script Debugger IE,...), . , , Chrome Dev Tools Uncaught TypeError: Object #<an HTMLDocument> has no method 'observe', — DOM , , document.observe Prototype.
, , Uncaught TypeError: Object #<an HTMLDocument> has no method 'ready'. , jQuery jQuery:
$(document).ready(function() {
var loc = window.location.href;
$('aside li a').each(function() {
if (loc.indexOf(this.href) !== -1) {
$(this).addClass('selected');
}
});
});
jQuery, Prototype, , , Prototype:
document.observe("dom:loaded", function() {
var loc = window.location.href;
$$('aside li a').each(function(link) {
if (loc.indexOf(link.href) !== -1) {
link.addClassName('selected');
}
});
});
jQuery , jQuery jQuery.noConflict, Prototype $ ( jQuery, jQuery, jQuery ).