Monday, October 5, 2009

The JavaScript of Dreamweaver CS4 new character

On September 24, 2008, beijing - today, adobe company (Nasdaq: ADBE) the Adobe of milepost product – that announces to roll out industry®Creative Suite®4 products are familial. This product can apply at all originality job to flow, it is the banner design inside course of study and development software. The root nature that flows through the job is broken through, removed the barrier between stylist and development worker. Product line of new Creative Suite 4 includes hundreds innovation function, advanced in the round presswork, the originality process that video of sound of network, mobile, alternant, image makes. This product promotes the Flash technology of whole product line to integrated force and the new Gao Shuiping that behave force, it is Adobe up to now the most large-scale software version, content includes 14 Adobe Creative Suite 4 Design Editions, Creative Suite 4 Web Editions, Creative Suite 4 Production Premium, Adobe Master Collection and 13 foundations product, integrated technologies and 7 kinds of services.

The PreRelease edition that downloaded DreamWeaver CS4 in the government then will check, without what solution pressing and installation are too much want to say, it is sensory comparing only in the past the installation speed of DreamWeaver CS3 wants fast many, installation ends, discover interface and before the change with more constant than having photograph.

Besides the change on the interface, this version serves as a serious milepost edition, still have a lot of updating, such as:

Be aimed at the code clew of Ajax and JavaScript frame
Adobe InContext Editing
HTML data set
Subversion®Compositive
CSS optimal way
Etc, more can examine Fetures page of the government.

I basically introduce the partial new character about JavaScript to you here.

One, the catenary outside JavaScript code.
We know, stem from a variety of purpose considerations, we are absent commonly the page is direct compose JavaScript code, in the Js document that puts its outer ministry however, the profit that such doing, besides facilitating management besides the JavaScript of whole site, still conduce to client of great have the aid of carrying the cache of pair of Js files, the network of the Js file that reduces very few change transmits the waste of discharge.

Additional, stem from much person cooperation and facilitating management, facilitate sharp change and code are statified wait for a reason, we should as far as possible achieve a structure - expression - the depart of behavior, write in common code in, you may use such as in great quantities

<a Onclick="alert_me('this Is A Link')" Href="#">Click To Alert Me</a>
Such code, however, such doing is action coupling reached in basic code structure however, we advocate the means with adding incident to depart its completely in JavaScript code, this operation also can be finished by DreamWeaver CS4.

In DreamWeaver CS4, provided this function for us, you can be in this function [Commands] - > [Externalize JavaScript] in find.

To test these two character, our compose the code that be as follows:

<! DOCTYPE Html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html Xmlns="http://www.w3.org/1999/xhtml ">
<head>
<meta Http-equiv="Content-Type" Content="text/html; Charset=utf-8" />
<title>Untitled Document</title>
<script Type="text/javascript ">Function Alert_me(msg)
{Alert(msg);
}
</script>
</head>
<body>
<a Href="#" Onclick="alert_me('this Is A Link')">Click To Alert Me</a>
</body>
</html>
You can see, in this paragraph of code, appeared in the page not only JavaScript function, and still bind behavior directly was in surely in HTML label, use at this moment [Commands] - > [Externalize JavaScript] the tool that will open DreamWeaver CS4 to be offerred for us, you can see, have two option, they part corresponding the JavaScript in the page code piece depart mixes for exterior file depart meanwhile the JavaScript in HTML code:

We choose " Externalize JavaScript And Attach Unobtrusively " , finish the depart of the code in code piece and label at the same time namely, the command is carried out after finishing, the code of the page is as follows:

<! DOCTYPE Html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html Xmlns="http://www.w3.org/1999/xhtml ">
<head>
<meta Http-equiv="Content-Type" Content="text/html; Charset=utf-8" />
<title>Untitled Document</title>
 
<script Src="SpryAssets/SpryDOMUtils.js" Type="text/javascript"></script>
<script Src="Untitled-15.js" Type="text/javascript"></script>
</head>
<body>
<a Href="#" Id="a1">Click To Alert Me</a>
</body>
</html>
Such, with respect to automation completed corresponding work.

2, JavaScript code clew.
All the time since, development JavaScript does not have the IDE of special without difficulty, aptana is a JavaScript that is based on Ecplise to develop a tool, provided code Gao Liang and code clew function, nowadays, dreamWeaver CS4 also provided this function, when our compose establishs target of the buy inside JavaScript, it can have undertaken code hinted.

Divide this beyond, dreamWeaver CS4 still offerred wrong to code hint, pile up occurrence mistake now, the clew that there will be a yellow in window top, in code at the same time left firm is in a label.

3, the support to library of tripartite JavaScript.
The tripartite that the Aptana that mentions above offers a variety of pair of JavaScript at the same time kind library, the support that waits like Prototype, JQuery, YUI, ExtJS, dreamWeaver CS4 was offerred as much, we introduce library of a Prototype above all, pass input New Ajax next. , try the application that compose proposes an Ajax, right now DreamWeave CS4 gave out Ajax kind the code clew of member method.

Article provenance: HTtp://www.hanguofeng.cn/archives/web-client/dreamweaver-cs4-new-feture-javascript

No comments:

Post a Comment