background preloader

In JavaScript

In JavaScript
JavaScript is a general purpose programming language that was introduced as the page scripting language for Netscape Navigator. It is still widely believed to be a subset of Java, but it is not. It is a Scheme-like language with C-like syntax and soft objects. JavaScript was standardized in the ECMAScript Language Specification, Third Edition. JSON is a subset of the object literal notation of JavaScript. In this example, an object is created containing a single member "bindings", which contains an array containing three objects, each containing "ircEvent", "method", and "regex" members. Members can be retrieved using dot or subscript operators. myJSONObject.bindings[0].method // "newURI" To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. var myObject = eval('(' + myJSONtext + ')'); The eval function is very fast. To defend against this, a JSON parser should be used. var myObject = JSON.parse(myJSONtext, reviver);

JavaScript Doesn’t Suck At the Web Directions South conference last week, SitePoint’s Kevin Yank had the opportunity to speak with Douglas Crockford, Yahoo architect and expert on all things JavaScript. Douglas presented a talk entitled Web Forward! (formerly Ajax Security), in which he described the potential of – and problems with – JavaScript as a language, and how it would need to change for the Web to continue its evolution. He focused heavily on how the current process for developing web standards is failing us, and how the looming browser war could provide the solution. Hi, this is Kevin Yank from sitepoint.com, and I’m here at Web Directions South, 2008 with Douglas Crockford from Yahoo. Hi Doug. Hi. So, I’ve heard you say several times just how much JavaScript sucks, and how many problems there are with it, and yet you seem to devote yourself to it with a lot of passion. Ah, that’s fair enough. I am very clear about its shortcomings. Yeah. They were really lucky. I think so, and I think we need to.

Hacks to Beat Rapidshare Download Limits and Waiting Time - Tech Here are some hints to help you more efficiently use rapidshare. Skipping waiting time and bypassing download limits are rapidshare hacks that everybody should know. These tips have been retested and continue to work well. Updated Oct, 2010. Rapidshare has been an excellent tool for sharing large files. Recently users have discovered ways of bypassing the download limits and skipping waiting times. Several readers have emailed recently (Oct 2010) that these methods continue to work well. Update: Two new methods of bypassing download limits have been posted. RapidShare: NIC tricks and MAC cloning to bypass download limit Rapidshare traces the users IP address to limit each user to a certain amount of downloading per day. Here are some methods for doing this: 1.Short-Out the JavaScript: 1. 2.Request a new IP address from your ISP server. Here’s how to do it in windows: 1. 5. Frequently you will be assigned a new IP address when this happens. 3.Use a proxy with SwitchProxy and Chrome: 1. 4. 1.

2 hours of Video on JavaScript from Douglas Crockford I spend a lot of time doing web development in my daily life. I am employed as a software engineer, and as part of that employment, I get the opportunity to program in JavaScript from time to time. I’ll be the first to admit that I am not great at it, as the language was never formally “taught” to me. Because of this, I have found several interesting parts of the language that have caused me some problems over time. Below are several links to videos containing instruction from Douglas Crockford on the do’s and dont’s of the JavaScript language, which I found very informative, given the problem I ran into a while ago on the project I am working on. The problem I had to solve was introduced by another programmer, and that is: he did not formally declare a variable, but instead just started using it. Well, it turns out, I got the task of debugging this particular code, which was throwing some sort of “index out of bounds” error that no one could find.

Manually Installing The Latest Firefox in Kubuntu : A Cleaner In If you've enjoyed this blog, please consider picking up a copy of my Ubuntu book, Instant Ubuntu. Thanks for visiting! So I’ve decided that Konqueror is just not the web browser that some people want it to be. Call me spoiled / ruined for having spent so much time on Firefox, but I just can’t use it to be as productive as I want to be so I’ve installed Firefox on my Kubuntu installation. For those of you that are in similar situations keep reading and find out how to manually install Firefox within KDE. Now, I am perfectly aware that I can download and install the Firefox package simply and easily using Adept or aptitude. Installing Firefox Manually Update: I found in some additional testing that using the following command *just* installed Firefox and none of the other packages so.. you take your pick: (I normally use aptitude to install which installed optional packages as well). sudo apt-get install firefox Download the latest version of Firefox from the Mozilla web page. Done.

JavaScript: The Good Parts I found a really nice video lecture on JavaScript. I'm a JavaScript journeyman myself so I decided to review it to learn something new. I have written about JavaScript in the past -- the previous post on JavaScript was "Learning JavaScript through Video Lectures". This lecture is given by JavaScript guru Doug Crockford. The talk is based on Douglas's recent book "JavaScript: The Good Parts". The lecture begins with a brief intro of why JavaScript is the way it is and how it came to be so. You're welcome to watch the video lecture. Here are some interesting points from the lecture: [11:38] JavaScript bad parts: [17:25] for ... in operator mixes inherited functions with the desired data members (it does deep reflection). for (name in object) { if (object.hasOwnProperty(name)) { ... } } [22:00] Javascript good parts: Lambda. [23:00] Two schools of inheritance - classical and prototypal. [24:35] Realization of prototypal inheritance in JavaScript: if (typeof Object.create ! [42:42] JSLint.

Quick Guide to Prototype Introduction JavaScript’s increasing popularity throughout the web makes it more important than ever to make sure our client side code is implemented with a nice mix of stability, speed, and reusability. One of the best ways for accomplishing this is to use a simple library and syntax to use as a foundation for every project. Thankfully, Sam Stephenson created an amazing library of functions that we can rely on called Prototype.js to ease our JavaScript development practices. After our readers pointed out in an previous feature that our frequent use of Prototype syntax was making things a bit confusing, we decided it would be best to create a quick reference page for the library to help ease the learning curve for a lot of developers out there. The following tutorial will explain the most common methods used in Particletree projects with simple examples of how to implement them. Getting Started Boom. Note - This tutorial is based off of version 1.3.1. $() Function node = $("elementID");

Request Douglas Crockford douglas@crockford.com 2006-04-17 (Updated 2012-08-10) Abstract XMLHttpRequest has a security model that is inadequate for supporting the next generation of web applications. JSONRequest is proposed as a new browser service that allows for two-way data exchange with any JSON data server without exposing users or organization to harm. It exchanges data between scripts on pages with JSON servers in the web. It is hoped that browser makers will build this feature into their products in order to enable the next advance in web application development. Motivation The next generation of web applications will be much more data intensive. XMLHttpRequest is constrained by the Same Origin Policy. If the Same Origin Policy were not in place, then the user could be harmed by XSS (cross site scripting) attacks. If the Same Origin Policy were not in effect, a pirate.net page could send a request via XMLHttpRequest to penzance.org. JSONRequest JSONRequest is a global JavaScript object.

Know Dot Net - How to Create a Numeric Only TextBox Control Have you ever needed a Windows.Forms.TextBox control that only accepted letters, or that only accepted numbers? Well, the other day, I needed one and after some playing around, I decided that it's something I may well need in the future. Taking the simple logic contained below, you can easily subclass the Winows.Forms.TextBox control and stick it in your toolbox for later use. <Note that for the sake of illustration, I created two extra Booleans to use in the evaluation...you could save yourself two lines of code by including them directly>The use above will allow all valid numbers as well as decimals. To flip this around, if you wanted to allow only Letters in your text box... the following should do it for you: Now, you could easily combine these types of methods with some more sophisticated methodology, allowing for overloads for instance, to create a textbox that validates the input and changes color according to certain specifications:

Related: