Some new features of Dreamweaver CS4 JavaScript

Source: Internet
Author: User
Tags new features xmlns

In addition to changes in the interface, DreamWeaver CS4 as an important milestone, there are many updates, such as:
* Code hints for Ajax and JavaScript frameworks
* Adobe Incontext Editing
* HTML Data set
* subversion® Integration
* CSS best practices, and more can view the official Fetures page. I'm here to introduce you to some of the new features of JavaScript.
is in the official download Dreamweaver CS4 prerelease version to test, decompression and installation of nothing too much to say, just feel more than the earlier AH Dreamweaver CS3 installation speed is much faster, installation finished, found that the interface with a certain change compared to before, As shown in the figure (above is Dreamweaver CS3, the following figure is Dreamweaver CS4):



In addition to changes in the interface, this version is an important milestone, with many updates, such as: &NBSP
Code hints for Ajax and JavaScript frameworks  
Adobe incontext Editing &NBSP
HTML DataSet  
subversion® integration  ,
CSS best practices, and more can view the official Fetures page. &NBSP
I'm here to introduce you to some of the new features of JavaScript. &NBSP
One, outside the JavaScript code chain.  
We know that, for a variety of purposes, we generally do not write JavaScript code directly on the page, but instead place it in an external JS file, the advantage of doing so, in addition to easy management of the entire site's JavaScript, Also help a lot with the client to the JS file cache, reduce the little change in the JS file network transmission flow of waste. &NBSP
In addition, for reasons such as multiple collaboration and ease of management, ease of agile change, and code layering, we should try to do as much as possible with the structure-performance-behavior separation, where you might use a lot of the usual code writing, such as  
<a onclick= " Alert_me (' This is a link ') "href=" # ">click to alert me</a>
Such code, however, does this by coupling behavior into the basic code structure. We advocate adding events in a way that completely separates them into JavaScript code, which can also be done by Dreamweaver CS4. &NBSP
in Dreamweaver CS4 provides us with this feature, which you can find in "Commands"-> "Externalize JavaScript". &NBSP
To test these two features, we wrote the following code: &NBSP
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "
<title>untitled document</title>
<script type=" Text/javascript "
function Alert_me (msg)
{
Alert (msg);
}
</script>
<body>
<a href= "#" onclick= "Alert_me (' is a link ')" > Click to alert Me</a>
</body>
You can see that in this code, not only does the JavaScript function appear on the page, It also binds the behavior directly to the HTML tag, using the "Commands"-> "Externalize JavaScript" to open the tools that Dreamweaver CS4 provides, and you can see that there are two options, They correspond to just separating the JavaScript blocks of the page into external files and at the same time separating JavaScript from the HTML code, as shown in figure:  


We select "Externalize JavaScript and Attach unobtrusively", that is, to complete the separation of code blocks and tags, and after the execution of the command, the code for the page is as follows: &NBSP
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "
<title>untitled document</title>

<script src=" spryassets/ Sprydomutils.js "_fcksavedurl=" "Spryassets/sprydomutils.js" "type= text/javascript" ></SCRIPT>
< Script src= "Untitled-15.js" type= "Text/javascript" ></SCRIPT>
<body>
<a href= "#" id= "A1" >click to alert me</a>
</body>
This completes the appropriate work automatically. &NBSP
II, JavaScript code hints
All along, developing JavaScript is not particularly handy Ide,aptana is a ecplise based JavaScript development tool, With code highlighting and code hints, DreamWeaver CS4 also provides this feature, and when we build JavaScript-built objects, it's already ready for code hints, as in figure:  


In addition to this, DreamWeaver CS4 also provides hints for code errors that, when errors occur, will have a yellow cue bar at the top of the window, along with the line number at the left of the code, as shown:


Iii. support for third party JavaScript libraries
The above mentioned Aptana also provides a variety of JavaScript of the Third-party library, such as prototype, JQuery, YUI, ExtJS, and other support, DreamWeaver CS4 also provided, we first introduced a prototype library, Then, by entering new Ajax, and trying to build an AJAX application, Dreamweave CS4 gives code hints for Ajax class member methods, as shown in the figure:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.