This file contains 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
var report = { | |
name: 'xyz', | |
type: 'monthly' | |
} | |
console.dir(report) | |
Object | |
name: "xyz" | |
type: "settlement" | |
__proto__: Object |
This file contains 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
Object | |
name: "xyz" | |
type: "settlement" | |
__proto__: Object | |
__defineGetter__: function __defineGetter__() { [native code] } | |
__defineSetter__: function __defineSetter__() { [native code] } | |
__lookupGetter__: function __lookupGetter__() { [native code] } | |
__lookupSetter__: function __lookupSetter__() { [native code] } | |
constructor: function Object() { [native code] } | |
hasOwnProperty: function hasOwnProperty() { [native code] } |
This file contains 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
report[toString] = function() {// do something toStringy | |
} | |
report.hasOwnProperty(toString) | |
true | |
// now when you inspect the report object | |
Object | |
function toString() { [native code] }: function () {// do something toStringy | |
} | |
name: "xyz" |
This file contains 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
var fs = require("fs"), | |
path = require("path"), | |
p = "/some-app/webapp/WEB-INF/jsp", | |
files, | |
result = { | |
"name": null, | |
"type": null, | |
"location": null | |
}, | |
allResults = new Array(); |
This file contains 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
var terminal = require('child_process').spawn('cmd'); | |
terminal.stdout.on('data', function (data) { | |
console.log('stdout: ' + data); | |
}); | |
terminal.on('exit', function (code) { | |
console.log('child process exited with code ' + code); | |
}); |
This file contains 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 src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="http://localhost:8111/socket.io/socket.io.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<h4>WebSocket Test</h4> | |
<h3>Status: <span id="status">Waiting</span></h3> |
This file contains 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
// This is important, the io.connect has to point where socket server | |
// is running - simple but took me while to connect the periods/dots/slashes...it's weekend, what am I doing? | |
var socket = io.connect('http://localhost:8111'); | |
// image related socket | |
socket.on('user image', function(m){ | |
// $('#imageReceivedMessage').text("> "+m); | |
$('#imageSentFromServer').attr('src', m); | |
}); |
This file contains 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
var http = require('http'), | |
io = require('socket.io'), | |
sys = require('sys'), | |
express = require('express'), | |
fs = require('fs'); | |
var port = 8111; | |
var app = express(); | |
app.use(express.errorHandler({showStack: true, dumpExceptions: true})); |
This file contains 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
<div id="asyncCall" style="width: 10px;"> | |
<input id="moneyman" style='width:190px;' type="button" value="Request Money"> | |
<span id="asyncErrors" style="color:red;"></span> | |
</div> |
This file contains 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
$('#moneyman').each(function() { | |
$("<button id='moneyman'><img src='/ap/resources/images/299.GIF' />).attr( | |
{ name: this.name, | |
value: this.value | |
}).insertBefore(this); | |
}).remove(); |