Jump to content

Dreamweaver ,JavaScript


kv79

Recommended Posts

Hi , on W3School I was learning when i write a code i need to write in <html> tags .

<html><body><script type="text/javascript">document.write("Hello World!");</script></body></html>

But when I open a basic page->JavaScript of Dreamweaver ,the product are acting like they do not know JavaScript WC3Schooland ours standard to write in HTML ,so Am i so uninformed about JavaScript or there is no any possibility to write JavaScript except into this code above .Thank for your effort of reading my message

Link to comment
Share on other sites

if you are opening a javascript document in dreamweaver then it is only a script page, you need to open a HTML or PHP.... page and write your code between the <head> tags, or anywhere in the <body>, depends on what the code use is.Is that helpful ?

Link to comment
Share on other sites

Otherwise you could write your script onto a javascript page (.js) and import it into what html/php pages you like by using this code:

<script type="text/javascript" src="http://www.domain.com/JavaScriptDocument.js" />

Link to comment
Share on other sites

Yeah, I advise you to not use Dreamweaver when you're first learning, for at least two reasons:

  • When Dreamweaver makes a JavaScript file, it assumes that you already understand where, how, when, and why to put the JavaScript code. With Notepad, you're not tempted to stray from the tutorial.
  • If you use Design mode, it can really screw up your page just like all WYSIWYGs. Note that I don't mean that your page will look horrible in a browser, but the HTML source won't be very intelligently written, and that can make it harder to edit your pages (and you might pick up some bad coding habits from it). I don't use Design mode, either, and I've been at this ... *thinks* ... about 3 years now, I think.

Link to comment
Share on other sites

Well, Dreamweaver can't parse JavaScript as it only provides a preview of your page, instead of running it. Opening your page in a web browser (with run local active content enabled) will allow yoru JavaScript to run.

Link to comment
Share on other sites

Dreamweaver's code view has some advantages (very good syntax highlighting and code completion in almost all web development languages), but WYSIWYG is never good.

Link to comment
Share on other sites

To clarify, I find Dreamweaver very useful as a source editor. I don't use it for anything except to create and edit files, but I find it to be much better than the two open-source editors I found by this forum (PSPad and Notepad++ - didn't bother downloading any others). (My main complaint against them is that, if you use Ctrl+Z or Ctrl+Y too many times, they start eating code. But I also like tag completion.)

Link to comment
Share on other sites

Learn how to code something yourself, don't take the lazy way out. No offense to people who use Dreamweaver, but a retarded orangutang that knows sign language can write better valid HTML than Dreamweaver 99% of the time.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...