This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type='text/javascript' src='jquery.js'></script> | |
<script type='text/javascript'> | |
$(function() { | |
//invoke here when dom is ready | |
alert($('#main').text()); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type='text/javascript' src='jquery.js'></script> | |
<script type='text/javascript'> | |
$(function() { | |
alert($('div').filter('.hide').text()); | |
alert($('div').find('.hide').text()); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type='text/javascript' src='jquery.js'></script> | |
<script type='text/javascript'> | |
//which is called early, ajaxStop or load? | |
$(function() { | |
$('#log').ajaxStop(function() { | |
$(this).text('trigger ajaxStop'); | |
alert($('#result').text()); //this method is later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery-ui.js"></script> | |
<script type="text/javascript" src="drop_test.js"></script> | |
<style> | |
#ans_container { | |
width: 400px; | |
height: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.rightClick.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var zoom_ratio = 1; | |
//set original coords |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery-ui.js"></script> | |
<script type="text/javascript" src="jquery.rightClick.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var zoom_ratio = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.rightClick.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#content').offset({top: $('#view_window').width() / 2, left: $('#view_window').height() / 2}); | |
$('#view_window').click(function(event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.rightClick.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var zoom_ratio = 1; | |
$('#content').offset({top: $('#view_window').width() / 2, left: $('#view_window').height() / 2}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
//papa crock's code | |
if (typeof Object.create !== 'function') { | |
Object.create = function(o) { | |
var F = function(){}; | |
F.prototype = o; | |
return new F(); | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# conding: utf-8 | |
# | |
# this script shows pid which contains 'ruby' | |
# | |
require 'pty' | |
cmd = 'ps aux | grep ruby' | |
PTY.spawn(cmd) do |reader, writer, pid| |