dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Beginner to Javascript, Trying to Learn, Help Needed to Program Simple Process

  1. #1
    Join Date
    Jul 2009
    Posts
    1

    Beginner to Javascript, Trying to Learn, Help Needed to Program Simple Process

    To Anyone Willing To Help,
    I am very new to Javascript and am looking for two things. First is, what application should I program Javascript in (I've heard Eclipse is the best). Secondly, could somebody show me how to write out a simple process that does the three things.

    First, it opens a URL. Waits a certain amount of time and then closes the webpage (if there's anyway to close the webpage after a certain amount of inactivity, that would be an option as well. Similarly, I plan to run an iMacro (an add-on in Firefox) in the webpage, so if somebody knows how to close the browser or page once the iMacro complete, that would be ideal). Finally, I want this entire process to repeat itself every certain amount of time, so lets say 10 minutes. So, to sum up, the code opens the URL, waits for the iMacro to complete, then closes the URL, and repeats every certain interval of time.

    I plan to learn from this code so if it could be as elegant, efficient, and clean as possible it would be greatly appreciated (better to learn it right and not pick up any bad habits). Furthermore, if you can't code the entire process, but know how to code part of it, please post that part with an explanation of what the code will do; I can still learn from it, and maybe somebody else reading the thread could build upon it.

    Thank you,
    Gavin

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    Java and JavaScript are related only by name, they are two totally different languages. Eclipse is for Java, a simple text editor is sufficient for JavaScript. W3Schools is as good a place as any to start.

  3. #3
    Join Date
    Jul 2009
    Posts
    45
    The following code closes the browser window after 3 seconds.
    javascript:setTimeout(function(){return window.close();},3000)(); //Paste in your address bar.

    What you really want is the following though.
    http://www.w3schools.com/HTMLDOM/met_win_open.asp

    But you need to learn javascript before going on.

    To learn javascript, or any language, read tutorials and other's code, programs examples, then start your own project and get reviewed.

    Every browser has javascript installed. So all you need is a basic text editor.
    Notepad is ok, but notepad++ even better.
    Windows Notepad++: http://portableapps.com/apps/develop...padpp_portable

    Use Firefox with firebug addon installed when programming in javascript.
    Firefox: www.firefox.com
    Firebug: www.getfirebug.com/ *Best debugger

    Tutorials:
    - www.w3schools.com/JS/default.asp *Play with the example!
    - https://developer.mozilla.org/en/a_r..._to_javascript *Explore the site.
    - http://www.hunlock.com/blogs/Masteri...ascript_Arrays *Read all the chapters.

    Always run your code through jslint. It will kill your bad habits fast.
    www.jslint.com

    After you learn javascript, then learn a framework to save you a ton of time.
    Jquery: http://docs.jquery.com/Alternative_Resources
    Mootools: http://mootools.net/docs/core

  4. #4
    Join Date
    Jul 2009
    Posts
    62
    there are subject on w3schools that are clearer on this site http://www.tizag.com/javascriptT/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles