Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30456

Re: Modular code, HTML, HTML5 and JS

Newsgroups comp.lang.javascript
Date 2016-05-17 01:50 -0700
References <ec9a7a6b-b3af-4d83-9b28-e9fff5c24f4b@googlegroups.com> <17fce13d-9aa4-486e-8c24-e40dd354d9b7@googlegroups.com>
Message-ID <e99af7aa-4242-4886-ac80-b20db9efb7c2@googlegroups.com> (permalink)
Subject Re: Modular code, HTML, HTML5 and JS
From jonas.thornvall@gmail.com

Show all headers | View raw


Den tisdag 17 maj 2016 kl. 10:44:12 UTC+2 skrev jonas.t...@gmail.com:
> Den tisdag 17 maj 2016 kl. 10:19:37 UTC+2 skrev jonas.t...@gmail.com:
> > I decided to try write abit more modular code, but i have no real good example of how to do it.
> > 
> > Lets say i have index.html and main.js, i do have figured out how to call main.js from index.html. 
> > 
> > But what i would like to know is how do i refer a form with a textfiel within index.html?
> > Do the script know in which document the refered form reside?
> > 
> > In HTML pages with inline/embedded javascript, i know one do it like this.
> > 
> > document.myform.mytext.value = somedata;
> > 
> > I never quite understood what document refer to in this case.
> > I do have a memory passing data between frames, but never done it between a js and html file.
> > 
> > Is it enough just refer to the form like above?
> 
> It worked, but how to have each function reside within individual files is it just by listing the src within index.html?
> 
> <script type="text/javascript" src="main.js"></script>
> <script type="text/javascript" src="one.js"></script>
> <script type="text/javascript" src="two.js"></script>
> 
> And so on? will the functions within one and two be reachable from main without further refereces?

It worked, what is the penalty timewise to have the functions reside each within one file? Is it just the load time of script that change?

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Modular code, HTML, HTML5 and JS jonas.thornvall@gmail.com - 2016-05-17 01:19 -0700
  Re: Modular code, HTML, HTML5 and JS jonas.thornvall@gmail.com - 2016-05-17 01:44 -0700
    Re: Modular code, HTML, HTML5 and JS jonas.thornvall@gmail.com - 2016-05-17 01:50 -0700
  Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-17 10:17 +0100
    Re: Modular code, HTML, HTML5 and JS Wally W. <ww84wa@aim.com> - 2016-05-17 08:36 -0400
      Re: Modular code, HTML, HTML5 and JS Aleksandro <aleksandro@gmx.com> - 2016-05-17 20:30 -0400
        Re: Modular code, HTML, HTML5 and JS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-17 19:26 -0700
          Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-19 02:21 -0700
            Re: Modular code, HTML, HTML5 and JS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-19 05:04 -0700
              Re: Modular code, HTML, HTML5 and JS "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-05-19 14:36 +0200
                Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-19 14:37 +0100
                Re: Modular code, HTML, HTML5 and JS Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-05-19 18:18 +0200
                Re: Modular code, HTML, HTML5 and JS "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-05-19 18:21 +0200
                Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-19 18:22 +0100
                Re: Modular code, HTML, HTML5 and JS "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-05-19 21:51 +0200
                Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-20 03:47 -0700
                Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-20 11:57 +0100
                Re: Modular code, HTML, HTML5 and JS Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-05-21 20:09 +0100
                Re: Modular code, HTML, HTML5 and JS "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-05-20 13:07 +0200
                Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-20 05:09 -0700
                Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-20 05:23 -0700
                Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-20 03:54 -0700
                Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-20 12:06 +0100
                Re: Modular code, HTML, HTML5 and JS "Fernando D. Bozzo" <fdbozzo@gmail.com> - 2016-05-20 04:04 -0700
                Re: Modular code, HTML, HTML5 and JS Scott Sauyet <scott@sauyet.com> - 2016-05-23 03:21 +0000
                Re: Modular code, HTML, HTML5 and JS "Mel Smith" <syntel@cox.net> - 2016-05-24 16:03 -0600
        Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-18 08:57 +0100
        Re: Modular code, HTML, HTML5 and JS Tim Streater <timstreater@greenbee.net> - 2016-05-18 08:58 +0100

csiph-web