WebReference.com logo
tip archive  •   about  •   sitemap  •   contact  •   jobs  •   write for us  •   subscribe


[prev]

Introduction to Server-side JavaScript [con't]

Java Software Engineer / Architect Sr (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume

Coding for Jaxer

To tell the server where to execute the code, you need to add the runat attribute to <script> blocks. This attribute has several possible values, as follows:

Some special Function object properties can be declared on individual functions to control how they are managed. These can be used to override the containing script block runat setting for the individual function, thus allowing for more granular control. For instance, server-side functions can be declared proxied so they are callable from the client side. This is achieved by specifying a proxy property on the function object. The possible values for this property are true or false:

The code above groups similar functionality together, while allowing the getClientID() function to override the default runat="server" behavior so that it can be called from the client. This is possible because the runat attribute is present. In client scripts with no runat attribute, the option of programmatically changing it by setting a different runat or proxy value is not available.

You may also enjoy:

Alternatively, the Jaxer namespace provides a useful convenient proxie property to allow the proxy functions to be declared in a single group within your JavaScript code. It is an Array object, so functions can be assigned using any format or functions that are common to arrays:



Back in the "Debugging JavaScript: Beyond Alerts" article, I stated that we will be looking at some popular JavaScript debuggers and IDEs in up-coming pieces. In the next installment, we will be taking a look at the first of these: the Aptana Studio IDE. We'll be using it to build a simple file-based blog for Jaxer.


Rob Gravelle combined his love of programming and music to become a software guru and accomplished guitar player. He created systems that are used by Canada Border Services, CSIS and other Intelligence-related organizations. As a software consultant, Rob has developed Web applications for many businesses and recently created a MooTools version of PHPFreechat for ViziMetrics. Musically, Rob recently embarked on a solo music career, after playing with Ivory Knight since 2000. That band was rated as one Canada's top bands by Brave Words magazine (issue #92) and released two CDs. Rob's latest, entitled KNIGHTFALL, was a collaboration between himself, the former Ivory Knight vocalist, and legendary guitarist/producer, Jeff Waters of Annihilator fame. Rob is available for short-term software projects and recording session work. to inquire, but note that, due to the volume of emails received, he cannot respond to every email. Potential jobs and praise receive highest priority!

Original: July 9, 2009

Social Bookmark


[prev]

Recent Articles

WebReference.com site name
Installing and Using Meeplace, the Business Review CMS
Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2
Create Multilingual Web Sites with Windows Unicode Fonts
internet.com site name
MySql View Technique for Grouping Crosstab Column Data
Why You Need a Mobile Web Site
Tame Web Marketing with Social Media Management



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers