JavaScript
  Home arrow JavaScript arrow JavaScript Remote Scripting: Building an A...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

JavaScript Remote Scripting: Building an AJAX-based Random Code Generator
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2005-10-19

    Table of Contents:
  • JavaScript Remote Scripting: Building an AJAX-based Random Code Generator
  • Protecting against automated data submission: the basics of a random data generator
  • Implementing the core logic of the script: defining the “statusChecker()” function
  • Avoiding simultaneous data submission: coding the “removeActiveNodes()” function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    JavaScript Remote Scripting: Building an AJAX-based Random Code Generator


    (Page 1 of 4 )

    This article explains how to build a random code generator, specifically applied to a voting system. This will help you to avoid system hacks involving automated submissions.

    This is part four of the series “JavaScript Remote Scripting.” Welcome back. As you probably remember, over the previous tutorial I explained how to use standard DOM methods for fetching server-side parsed XML files and displaying their contents on a browser. Since most remote scripting concepts are best understood by example, I followed a practical approximation by exploring the makings of a JavaScript-based application aimed at displaying some headlines, which were originally structured as XML nodes within a data file.

    Whether you’re wishing to go through the implementation of simple JavaScript snippets for sending silent http requests on the fly and provide visitors with richer interactivity, or building a full-featured application that relies heavily on XML for running a Web service, remote scripting based on JavaScript can bring you additional functionality without the need to mess up programming logic with “dirty” code for handling overlapped application layers.

    Now, by taking another look at the series of practical examples that I showed in my previous articles, in this part of the tutorial, I’ll go through the required explanations –- of course, accompanied by the appropriate source code -- for developing a random code generator, specifically applied to a voting system, similar to many applications that you can find on the Web today. Certainly, for the sake of clarity, let me explain first what you’ll find out in this article: I’m not going to demonstrate how to build a full-blown voting system, since that’s out of the scope of this tutorial. Instead, I’ll show you how to add some boxes populated with challenge values (generated on the server). This will avoid leaving the system, which requires a user to enter data manually, vulnerable to being hacked with automated submissions.

    The main advantage of implementing such as protecting mechanism is that you can develop your voting system (or another application) by coding all the required data validation on the server, while maintaining the extra functionality offered by JavaScript only on browsers with scripting enabled. By writing the application from that programming point of view, you can make sure that the security of the program, as well as its overall operability, is never compromised by the availability (or not) of JavaScript in the client.

    Having detailed the key concepts for applying remote scripting on a random data generator, it’s time to move on and start coding the application. Let’s go!

    More JavaScript Articles
    More By Alejandro Gervasio


       · In this tutorial, I explore the implementation of a JavaScript application for...
     

    JAVASCRIPT ARTICLES

    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...
    - Bulleted Menu of Links
    - Creating Click Loggers and Basic Markers wit...
    - Adding Pan Controls to Yahoo! Maps







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway