Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 JAVASCRIPT


  Prototypes in JavaScript

Following on from his previous article, David Chisnall explores JavaScript as an example of prototype-based object orientation. In this article, he shows how it's possible to implement more complex object models on top of this simple abstraction.My previous article, Prototypes and Object Orientation, considered the differences between class-based and prototype-based object orientation. In this article, we'll look in a bit more detail at the workings of the JavaScript object model, since it's currently the most popular prototype-based object-oriented language.What's New?In Self, you create...

2,975 0       JAVASCRIPT PROTOTYPE OBJECT ORIENTED OBJ


  Manipulating JavaScript Arrays

Our first tutorial on JavaScript arrays covered the basics: creating arrays, accessing the contents of arrays, array lengths, and looping through arrays.In this tutorial, you explore arrays in more depth, and learn how to use various methods of the Array object to manipulate arrays.Extracting sections of an array with slice()You're not limited to accessing single array elements at a time. Thanks to the slice() method, you can grab a whole section of an array at once. slice() has the following syntax:arraySlice = array.slice ( begin [, end] )The two parameters, begin and end, work as follows:be...

9,908 0       JAVASCRIPT ARRAY MANIPULATE JOIN SPLICE


  JavaScript: Passing by Value or by Reference

In JavaScript, we have functions and wehave arguments that we pass into those functions. But how JavaScript handleswhat you’re passing in is not always clear. When you start getting intoobject-oriented development, you may find yourself perplexed over why you haveaccess to values sometimes but not other times.When passing in a primitive type variablelike a string or a number, the value is passed in by value. This means that anychanges to that variable while in the function are completely separate fromanything that happens outside the function. Let’s take a look at the followingex...

4,128 1       JAVASCRIPT FUNCTION PASS BY REFERENCE PA


  JavaScript showModalDialog method

In JavaScript, showModalDialog()  method creates a simple modaldialog box which is a simple html page but when a modal dialog opens, user can't switch to another page until it closes the modal dialog box.Syntax:  window.showModalDialog( url, arguments, feature options); Where url is the URL of page which is to be opened in modal window and argumentsare those arguments which we are passing to the modal window and featureoptionsare the attributes set for the modal window.Description of code:Suppose we have an image file and we want to view that particular image fileinto a separat...

10,270 0       JAVASCRIPT JS SHOWMODALDIALOG EXAMPLE


  JavaScript is now a necessity

I've long looked at JavaScript as a second-class citizen in the programming world. Early on, it was the source of numerous security problems; it was a nice bit of glue to patch together HTML applications with a bit of styling, but nobody would use it for serious code; and so forth. Java, Ruby, Python, they were the languages for doing real work. But my attitude toward JavaScript has changed completely in the past few years. JavaScript has "grown up." I'm sure there are many JavaScript developers who would take issue with that judgement, and argue that JavaScript has been a capable, mature, and...

4,541 0       JAVASCRIPT HTML5 NECESSARY CLIENT LANGUA


  Ajax file upload tutorial

Step 1 - AJAX file uploadAJAX file upload tutorialFirst of all I have to say that to create a pure AJAX file upload system is not possible because of security limitations of JavaScript. All of the Ajax upload systems I know use some third party tool/package or only mimics the AJAX feeling. Even so it makes file upload process a bit nicer. In the next section I will present you a solution which imitates the AJAX process, but uses a normal upload process and iFrames.The concept: Create a simple HTML form for file uploadSet the target to an iFrame which is on the actual page but not visibleC...

6,683 0       PHP AJAX TUTORIAL FILE UPLOAD IFRAME


  5 Reasons Your Javascript Stinks

Javascript gets a bad rap on the Internet, but there are few languages that are so dynamic, so widespread, and so deeply rooted in our lives as Javascript is. The low barrier of entry leads some people to call it a script kiddie language, others scoff at the concept of a dynamic language while riding their statically typed high horse. You and Javascript just got off on the wrong foot, and now you've made it angry. Here's five reasons why your Javascript code sucks.1. You're not using a namespace.Remember in college when the teacher said you can't use global variables in your homework? Using gl...

3,053 0       PROTOTYPE JAVASCRIPT GOOD HABIT OOP


  Interaction between JavaScript and Frameset

ou want to change more than one frame at a time? OK, well here is how to do make the trick work for you!The first thing you will need is a frameset to get you started. Again, I will use a frameset with two frames. Here is the code for the frameset page:<HTML><HEAD><TITLE>Frames Example 5</TITLE></HEAD><FRAMESET cols=\"20%,80%\"><FRAME SRC=\"page1.htm\" name=\"left_frame\"><FRAME SRC=\"page2.htm\" name=\"right_frame\"></FRAMESET></HTML>Be sure you give each frame a name using the name=\" \" attribute. I named the frames above \"left_fr...

4,110 0       JAVASCRIPT INTERACTION HTML FRAMESET FRA