Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    problems testing javascript in dreamweaver

    I am using Adobe Dreamweaver to create a website. at the moment i am creating some javascript that should run immediately when the browser opens unfortunately it does not. Dreamweaver asks that i set up a test server in order to view dynamic data. The question is

    1. is it necessary to set up a test server if my site is not live and i am just previewing the javascript in Dreamweaver.

    2. if it is how do i set it up in Dreamweaver and examine the results of the code

    The problem is that i have script written but do not know whether it is good or bad because i can not view the execution of the code.

    I assume i could go to notepad++ and run the script but i was looking to understand why Dreamweaver is requiring me to set up a test server.

    thanks for all input guys.
    Last edited by sjames853; 02-28-2013 at 05:20 PM.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Even if you're using your computers built-in webserver (localhost, or 127.0.0.1), DW needs to know how to process the data. You _could_ open it locally (file:///whatever), but then things tend to behave differently because there is no FQDN domain (ie, www.domain.com, or localhost, or 127.0.0.1) to go through.

    So even if you're just testing JavaScript, DW needs a protocol to process it.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,734
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    As Old Pedant said recently, "It may or may not come as a surprise to you, but NightmarishStalker (the much more descriptive name for DreamWeaver) produces about the worst and most out of date JavaScript code possible. Such as new String(). Nobody that I know of in this forum is really willing to tackle DrunkWhomper code. We all prefer to just toss it out and use *GOOD* code."

    Why not just save the .html and.js files and run them in your browser?


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,190
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Dreamweaver is prompting you to setup a test server so that it can automatically rewrite certain relative links when it applies templates.

    you can get a free web server account from dozens of places. It might have an ad bar or slow performance, but it would at least allow you to test your code in a real web enviroment and give you the server addresss (ftp) that dreamweaver needs to perform high-level site management tasks on a templated site.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,480
    Thanks
    0
    Thanked 635 Times in 625 Posts
    Quote Originally Posted by Philip M View Post
    Why not just save the .html and.js files and run them in your browser?
    I agree - there are minor differences in how different browsers interpret some JavaScript so unless you actually test your JavaScript in those browsers you can't be sure it will work.

    You'll need to write the JavaScript using a different editor to DreamWeaver anyway since DreamWeaver can't produce JavaScript - what code it produces that it calls JavaScript is the sort of code that became obsolete with the introduction of Netscape 2 - which supported far better ways for the JavaScript to be written than that used by DreamWeaver.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,190
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by felgall View Post
    You'll need to write the JavaScript using a different editor to DreamWeaver anyway since DreamWeaver can't produce JavaScript - what code it produces that it calls JavaScript is the sort of code that became obsolete with the introduction of Netscape 2 - which supported far better ways for the JavaScript to be written than that used by DreamWeaver.
    it doesn't matter what editor you use to write javascript, they ALL produce the same output. If you are using a Dreamweaver feature other than the code editor to inject some javascript that YOU didn't write, well then, that's a whole different scenario.

    There is nothing inherently bad about using the editor inside of DreamWeaver, it actually has some decent features: ftp/dav/path access, auto-suggest, spellcheck, scoped find/replace, link-rewriting, built-in validation and W3 references, snippets, hotkeys, live preview for mobile, and more.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Agreed, RndMe.

    So long as you don't let it write any JS code (or ASP or PHP code) *for* you, it's quite usable.

    But you also should *not* trust its supposed JavaScript validation. Many times I've seen legitimate modern JS here in the forums that DW has rejected. And vice versa.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #8
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,480
    Thanks
    0
    Thanked 635 Times in 625 Posts
    Quote Originally Posted by rnd me View Post
    If you are using a Dreamweaver feature other than the code editor to inject some javascript that YOU didn't write, well then, that's a whole different scenario.
    DreamWeaver code view IS a different editor from the WYSIWYNG one that generates the garbage HTML and worse so called JavaScript. Using the code editor you can write proper code in any web language there just the same as in any other text based web editor.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #9
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For me too Notepad ++ is handy when compared to Dreamweaver. I often would think that I do not know to use the full features of dreamweaver. Can anyone explain how to set up the site with database in that?

  • #10
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello and thank you all for your input it has more than helped. I have decided i will run and test the code i write in notepad ++ to verify it works and then will implement it to my webpage.

    i have another question. Is Dreamweaver a good program to use to create the websites? I figure it is always better to test your javascript before you decide to put it in the code to be used. but is Dreamweaver good to work on HTML and css?

    What other programs are there to make creating websites faster and more efficient shall i say.

    Once again thank all of you for your input it has really helped.

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Dreamweaver tends to use obsolete HTML, but realistically it's fine for getting started.

    You can do yourself a big favor by then running the HTML it produces through the w3c HTML validator and correcting all the errors (and warnings, if possible) that it give you.

    As you get more experience, you'll start using it a lot less.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,734
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by sjames853 View Post
    Hello and thank you all for your input it has more than helped. I have decided i will run and test the code i write in notepad ++ to verify it works and then will implement it to my webpage.

    i have another question. Is Dreamweaver a good program to use to create the websites? I figure it is always better to test your javascript before you decide to put it in the code to be used. but is Dreamweaver good to work on HTML and css?

    What other programs are there to make creating websites faster and more efficient shall i say.

    Once again thank all of you for your input it has really helped.
    I would urge you to forget DreamWeaver and code by hand, using Notepad++.

    The effort you put in to learn to operate DreamWeaver would be far better employed on learning how to code HTML by hand. Then you will develop genuine expertise, as opposed to letting some code generator make your barely-understood code for you.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #13
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you all for your input again i will start using notepad ++ again.

    Are there any ways to create templates in notepad++?

  • #14
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,734
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by sjames853 View Post
    Thank you all for your input again i will start using notepad ++ again.

    Are there any ways to create templates in notepad++?
    Just save your templates as .html files using some suitable name.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #15
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Great stuff you guys. I appreciate all the advice. I also enjoy the fast response time great site.


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •