Home arrow JavaScript arrow Page 2 - Active Client Pages at the Server
JAVASCRIPT

Active Client Pages at the Server


Active Client Pages produce web pages at the client computer using web technology. The programming analysis, logic and calculations of the data for the pages are done at the client. The data to create the pages resides on the server. So what is the role of the server? That is what this article addresses. You need basic knowledge of JavaScript and Perl to understand it.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
October 20, 2009
TABLE OF CONTENTS:
  1. · Active Client Pages at the Server
  2. · The first thing that happens at the server
  3. · Using Perl to send a string to the client
  4. · Obtaining a string from any file in any directory at the server

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Active Client Pages at the Server - The first thing that happens at the server
(Page 2 of 4 )

In ACP you can get data (a string) from the server using either an external JavaScript tag in a JavaScript in a web page at the client, or you can use Ajax.

An example of an external JavaScript tag is:

<script src="xxx.js"></script>

This tag can be in the HEAD element or the BODY element of your web page at the client. The name of the file in the above tag is xxx.js. It is a JavaScript file. If the file is in a directory different from that of the web page, then in place of this file in the above statement, you should have a URL that looks something like this:

http://www.somewebsite.com/subdirectory/xxx.js

The last part of the URL is the file name. The script is downloaded as the browser on the client loads the web page. This JavaScript file simply contains JavaScript statements. The statements may change the content of the present web page or produce another web page at the client’s browser.

If you are getting the data from the server and using Ajax at the client, then you should have something like this in your Ajax code:

xmlHttp.open("GET","http://www.somewebsite.com/cgi-bin/exec.pl",true);

This statement will call the Perl file named exec.pl at the URL of http://www.somewebsite.com/cgi-bin/exec.pl. The exec.pl file is in the cgi-bin directory and it is executable; that is, as soon as it is called, it will be executed at the server.

The purpose of this execution is to get a string of data from the server and send to the client. The content of the string can be used to change the content of the current web page or produce a new web page at the client.

So the first thing that happens at the server is that a JavaScript file is downloaded from it to the client, or a Perl script is executed at the server to send a string to the client; either action depends on what you included in your web page.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials