Dreamweaver.MX.1002004.The.Missing.Manual [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Dreamweaver.MX.1002004.The.Missing.Manual [Electronic resources] - نسخه متنی

David Sawyer McFarland

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید













10.6 Inserting JavaScript




As Chapter 12 makes clear, Dreamweaver''s Behaviors (prewritten JavaScript programs)
let you add exciting interactive effectsmouse rollovers, pop-up windows, animated
layers, and so onwith very little effort. But they can''t do everything: When you, the
native JavaScript speaker, need to wade into the depths of JavaScript programming
yourself, you''ll find two entrances within Dreamweaver.


The most straightforward approach, especially if you''re already familiar with Java-
Script programming, is to simply switch into Code view (Ctrl+` [Option-`]) and type
away. Or, if you prefer, you can use Dreamweaver''s Insert Script window to add your
JavaScript code (see Figure 10-13).


Unlike the Code view, the
Insert Script window doesn''t
respond to the Tab key; if you''re
accustomed to indenting your
code, you''ll need to use spaces.
You can also insert noscript
informationtext that appears
if the Web browser doesn''t
understand JavaScript (noscript
only works, however, if you''re
adding a script somewhere in
the <body> of the page, not in
the <head>.



To do so, click in either the head or body section of the page, and then choose Insert
HTMLScript ObjectsScript (alternatively you can access this option from the
Script menu on the HTML tab of the Insert bar.) In the Insert Script window (Figure 10-13), choose a language from the menu: JavaScript, JavaScript1.1, JavaScript1.2, or
VBScript. (The JavaScript option works with all browsers that understand JavaScript,
while JavaScript 1.2 only works in 4+ version browsers. VBScript, on the other hand,
works only in the Windows version of Internet Explorer.)


Just type your script into the Content section (no need to include <script> tags, as
Dreamweaver handles that part) and then click OK. If you inserted the script in the
body of the document, you''ll see a small gold icon (indicating an invisible element
on the page) to mark its location.



NOTE



The JavaScript debugger that debuted in Dreamweaver 4 has been retired. Sorry.


You can edit your script in Code view, of course. In Design view, select the script icon
and then click Edit in the Property inspector.


Dreamweaver also lets you open and work on external JavaScript files (.js files) right
in Code view. The program doesn''t try to interpret the file as an HTML page; it won''t
attempt to make any of the changes described in Section 10.1.1. You can just use the builtin
text-editing capabilities of Code view to write your JavaScript programs.




JavaScript programming is no walk in the park. While it''s certainly easier to learn than full-featured
languages like Java or C++, it can still be challenging. If you want to get your feet wet, here''s a great resource
for basic tutorials and information on JavaScript:
www.Webmonkey.com/programming/javascript/
.




/ 192