Skip to content

Instantly share code, notes, and snippets.

@arestov
arestov / gist:223239
Created October 31, 2009 20:50
readyState == 1 (or any) for jquery
// readyState == 1 (or any) for jquery
var xhr = $.ajax(...);
xhr._onreadystatechange = xhr.onreadystatechange;
xhr.onreadystatechange = function() {
xhr._onreadystatechange();
if (xhr.readyState == 3) alert('Interactive');
};
/*
SoundManager 2: Javascript Sound for the Web
----------------------------------------------
http://schillmania.com/projects/soundmanager2/
Copyright (c) 2008, Scott Schiller. All rights reserved.
Code licensed under the BSD License:
http://www.schillmania.com/projects/soundmanager2/license.txt
V2.94a.20090717
$.ajax({
url: 'http://audme.ru/',
success: function(){
seesu.delayed_search.available.push('audme');
$('#mp3way-audme').removeClass('cant-be-used');
log('audme nice')
},
timeout: 7000,
error: function(){
log('audme error')
/*!
* Rocon: library that creates rounded corners
* @author Sergey Chikuyonok ([email protected])
* @link http://code.google.com/p/rocon/
*/
/**
* Общие методы и свойства для rocon
* @author Sergey Chikuyonok ([email protected])
* @copyright Art.Lebedev Studio (http://www.artlebedev.ru)
// Forcing Opera full page reflow/repaint to fix page draw bugs
function forceOperaRepaint() {
if (window.opera) {
var bs = document.body.style;
bs.position = 'relative';
setTimeout(function() {
bs.position = 'static';
}, 1);
}
}
var za = 'div';
var hey = function(){return false}
var t1 = (new Date()).getTime() ;
for (var i=0; i < 100000; i++) {
if (!!za.match(/^a$/i)){
hey()
};
var za = 'DIV';
var hey = function(){return false}
var t1 = (new Date()).getTime() ;
for (var i=0; i < 100000; i++) {
if (!!za.match(/^a$/i)){
hey()
};
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>ss</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<script type="text/javascript">
var external_playlist = function(array){ //array = [{artist: '', title: '', duration: '', link: ''}]
this.result = this.header + '\n';
for (var i=0; i < array.length; i++) {
this.result += this.preline + ':' + (array[i].duration || '-1') + ',' + array[i].artist + ' - ' + array[i].title + '\n' + array[i].link + '\n';
function allChildren(root) {
var node = root.firstChild;
var result = [];
var next;
while (node && node !== root) {
result.push(node);
next = node.firstChild || node.nextSibling;
$(function(){
var logger = $('<p></p>').css('color', '#222');
var log = function(logtext){
$(document.body).append(logger.clone().text(logtext + ' '));
}
log('btapp: ' + typeof btapp)
log('btapp.events: ' + typeof btapp.events)
log('btapp.events.all(): ' + typeof btapp.events.all())
log('btapp.events.all(): ' + JSON.stringify(btapp.events.all()))
log('btapp.events.all().torrent: ' + typeof btapp.events.all().torrent);