Pages

Friday, January 13, 2012

Javascript

1. When was the language developed?

Introduced in 1995, JavaScript, an object oriented web scripting language, has become an international standard allowing web developers the ability to write Dynamic HTML that works on multiple browsers.
2. For what purpose was the language developed?

JavaScript was crated as an alternative to the failing Java. The goal of the language was to create a lightweight and easy to learn language with the ability to script the behavior of web page content.
3. Who developed the language?

JavaScript was created by Netscape programmer Brendan Eich. The web scripting language was first released under the name of LiveScript as part of Netscape Navigator 2.0 in September 1995. It was renamed JavaScript on December 4, 1995
4. Is the language typically used on micro, mini, or mainframe computers?

The language is mostly used in simplifying website designs and code. Commonly used for popups
image rendering and other types of design. Also used to preform tasks, sort of like an Input Output machine.

5. Show us what the language looks like.





Roboto Bot (v. 0.1) - Example

Copyright 2011-2012 Jake Smith, Alain Gilbert and Turntable.fm

//BOT ACCOUNT
var bot = new Bot('auth+live+68149d90417e2243626a732561b4f923bb35a6d8', '4ebd50424fe7d07276000c25', '4e04350514169c1136006d6b');


//USERLIST

var theUsersList = { };

bot.on('roomChanged', function (data) {

// Reset the users list

theUsersList = { };

var users = data.users;
for (var i=0; i var user = users[i];
theUsersList[user.userid] = user;
}
});
bot.on('registered', function (data) {
var user = data.user[0];
theUsersList[user.userid] = user;
});
bot.on('deregistered', function (data) {
var user = data.user[0];
delete theUsersList[user.userid];
});

//COMMANDS
// Respond to commands!
if (data.text.match(/^\/hello$/)) {
bot.speak('Hey! How are you '+data.name+'?');

//WELCOME


bot.on('speak', function (data) {
if (data.text.toLowerCase().match(/^thanks roboto.*$/)) {
bot.speak("You're Welcome, "+data.name+"!");
}
});

//BACK

bot.on('roomChanged', function (data) { 
console.log(data);
  bot.speak('Roboto is back and better than ever!');

No comments:

Post a Comment

Comment Here.