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
<script type="text/javascript" src="scripts/persian.js"></script> | |
<asp:TextBox ID="TextBox1" runat="server" Text = "" ForeColor = "Gray"></asp:TextBox> | |
<div id="output"></div> | |
<script type="text/javascript"> | |
$("#<%=TextBox1.ClientID%>").keypress(function () { | |
if ($("#<%=TextBox1.ClientID%>").val() != "") { | |
console.log("key pressed"); | |
$("#output").html(persianJs($("#<%=TextBox1.ClientID%>").val()).englishNumber()); | |
} | |
}); |
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
function Array() { | |
var foo = this; | |
var bar = function() { | |
var ret = "Captured array items are: "; | |
//notify an attacker. Here we just display it | |
alert(ret); | |
}; | |
setTimeout(bar, 100); | |
} |
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
<script src="https://mail.google.com/mail/c/u/0/data/contactstore"></script> |
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
function assertType(obj, type) { | |
return obj.constructor.name === type.name | |
} | |
Object.prototype.assertType = function(type) { | |
return this.constructor.name === type.name | |
} | |
//Preparing test, mock objects | |
function Book(){}; |
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
$('.box').find('p'); | |
//or | |
$('.box').children('p'); |
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
$('.box p'); |
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
motionjs.transition([{ | |
select: "#hello_world", | |
duration: '4s', | |
style: { | |
top: '200px', | |
opacity: 1 | |
}, | |
end: function (event) { | |
alert("End of transition."); | |
} |
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
socket.on('connect', function () { | |
socket.on('message', function (data) { | |
var newElement = document.createElement('li'); | |
newElement.innerHTML = data.message[0] + ' says: ' + data.message[1]; | |
document.getElementById("list").appendChild(newElement); | |
}); | |
socket.on('announcement', function (data) { | |
var newElement = document.createElement('li'); | |
newElement.className = 'announcement'; |
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 buffer = []; | |
io.sockets.on('connection', function(client) { | |
client.emit('history', { buffer: buffer }); | |
io.sockets.emit('announcement', client.id + ' connected'); | |
client.on('message', function(message){ | |
var msg = { message: [client.id, message] }; | |
buffer.push(msg); | |
if (buffer.length > 15) buffer.shift(); | |
io.sockets.emit('message', msg); |
NewerOlder