Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modular code, HTML, HTML5 and JS

84 views
Skip to first unread message

jonas.t...@gmail.com

unread,
May 17, 2016, 4:19:37 AM5/17/16
to
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?

jonas.t...@gmail.com

unread,
May 17, 2016, 4:44:12 AM5/17/16
to
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?

jonas.t...@gmail.com

unread,
May 17, 2016, 4:50:21 AM5/17/16
to
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?

Wally W.

unread,
May 17, 2016, 8:36:29 AM5/17/16
to
On Tue, 17 May 2016 10:17:52 +0100, Tim Streater wrote:

>In article <ec9a7a6b-b3af-4d83...@googlegroups.com>,
>Why don't you buy a good book on html, another good book on javascript,
>and READ THEM.

Better yet, buy a book on PHP and don't bother visitors with running
javascript for basic functionality

Javascript is turned off in my default browser.

I might fire up a different browser for *your* site, but I will
probably look first for a site that has a better design. If I find
one, I will go there instead.

Aleksandro

unread,
May 17, 2016, 8:30:24 PM5/17/16
to
On 17/05/16 08:36, Wally W. wrote:
> On Tue, 17 May 2016 10:17:52 +0100, Tim Streater wrote:
>
>> In article <ec9a7a6b-b3af-4d83...@googlegroups.com>,
>> <jonas.t...@gmail.com> wrote:
>>
>>> 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.
>>
>> Why don't you buy a good book on html, another good book on javascript,
>> and READ THEM.

Why buy? everything is one web-search-engine search away.

> Better yet, buy a book on PHP and don't bother visitors with running
> javascript for basic functionality

Why not?

> Javascript is turned off in my default browser.
>
> I might fire up a different browser for *your* site, but I will
> probably look first for a site that has a better design. If I find
> one, I will go there instead.

People employing this criteria are the vast minority so you hardly exert
any sort of pressure to web developers.

Michael Haufe (TNO)

unread,
May 17, 2016, 10:26:51 PM5/17/16
to
On Tuesday, May 17, 2016 at 7:30:24 PM UTC-5, Aleksandro wrote:
> On 17/05/16 08:36, Wally W. wrote:
> > On Tue, 17 May 2016 10:17:52 +0100, Tim Streater wrote:

> >> Why don't you buy a good book on html, another good book on javascript,
> >> and READ THEM.
>
> Why buy? everything is one web-search-engine search away.

When coming from a position of ignorance, having a paradox of choice is hardly useful. What's disappointing is that the CLJS FAQ is quite dated regarding books/references:

<http://pointedears.de/scripts/faq/cljs/#books>

Admittedly I haven't done my part in submitting an update though...

I will of course give my personal suggestions of reading material on JavaScript for beginners/intermediate:

<http://eloquentjavascript.net/>
<http://effectivejs.com/>
<https://developer.mozilla.org/en-US/docs/Web/JavaScript>
<http://speakingjs.com/>
<http://exploringjs.com/>

Fernando D. Bozzo

unread,
May 19, 2016, 5:21:43 AM5/19/16
to
Hi Michael:

Are you the forum admin? If yes, then this links should be at the header of the forum as a fixed reference, as other Google groups have, because being as a normal post nobody can find them easyly.

Best Regards.-

Michael Haufe (TNO)

unread,
May 19, 2016, 8:04:31 AM5/19/16
to
On Thursday, May 19, 2016 at 4:21:43 AM UTC-5, Fernando D. Bozzo wrote:

> Hi Michael:
>
> Are you the forum admin?

No

Christoph M. Becker

unread,
May 19, 2016, 8:36:04 AM5/19/16
to
And actually, this is not a forum, but an unmoderated Usenet newsgroup.

--
Christoph M. Becker

Thomas 'PointedEars' Lahn

unread,
May 19, 2016, 12:19:02 PM5/19/16
to
Stefan Ram wrote:

> Tim Streater <timst...@greenbee.net> writes:
>>And it has nothing to do with Google Groups.
>
> When one believes that the expression
> »has something to do with« means »is the same as«.
>
> Dictionaries, however, explain it as:
>
> have to do with
>
> 1. to be related to or connected with
> 2. to be associated with; deal with

this.facepalm();

--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Evertjan.

unread,
May 19, 2016, 12:21:42 PM5/19/16
to
r...@zedat.fu-berlin.de (Stefan Ram) wrote on 19 May 2016 in
comp.lang.javascript:

> Tim Streater <timst...@greenbee.net> writes:
>>And it has nothing to do with Google Groups.
>
> When one believes that the expression
> »has something to do with« means »is the same as«.

This is about perceived facts, not by believes.

> Dictionaries, however, explain it as:
>
> have to do with
>
> 1. to be related to or connected with

Perhaps it is "connected to" in a "one way" sense,
and as done by Google not by Usenet,
but it is no more "connected with"
than Usenet with each of us.

> 2. to be associated with;

Guild by association, perhaps?

> deal with

It is not a "done deal",
they only bought a database of usenet history,
called "www.dejanews.com"
and look how they raped the poor thing.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Evertjan.

unread,
May 19, 2016, 3:51:13 PM5/19/16
to
Tim Streater <timst...@greenbee.net> wrote on 19 May 2016 in
comp.lang.javascript:

> In article <XnsA60DBAB4...@194.109.6.166>, Evertjan.
> <exxjxw.h...@inter.nl.net> wrote:
>
>>r...@zedat.fu-berlin.de (Stefan Ram) wrote on 19 May 2016 in
>>comp.lang.javascript:
>>
>>> Tim Streater <timst...@greenbee.net> writes:
>>>>And it has nothing to do with Google Groups.
>>>
>>> When one believes that the expression
>>> »has something to do with« means »is the same as«.
>>
>>This is about perceived facts, not by believes.
>
> Usenet has nothing to do with Google Groups, even though Google Groups
> thinks it has something to do with Usenet. But it doesn't actually tell
> people that, so the poor saps go around thinking that what they are
> using actually *is* Google Groups, when it isn't.
>
> That clear now?

Are we aggressive now!
Message has been deleted

Fernando D. Bozzo

unread,
May 20, 2016, 6:54:51 AM5/20/16
to
Hi Christof:

I've deleted my last post becuase too many questions.

I'm RTFM :)
https://en.wikipedia.org/wiki/Usenet
https://en.wikipedia.org/wiki/Usenet_newsgroup

I know about OLD newsgroups, but how rae the NEW newsgroups created? I only know how Google Groups are created, and the owner is the admin of what he create.

Thanks!



Fernando D. Bozzo

unread,
May 20, 2016, 7:04:06 AM5/20/16
to
El jueves, 19 de mayo de 2016, 14:36:04 (UTC+2), Christoph M. Becker escribió:
I'm curious, but how are everybody here accessing this (or other) Usenet Newgroups online? Are there a "better" way that doing from Google Groups?

At the beginning I've used Outlook Express with Microsoft Newsgroups and now I use Google, but for what I read here, seems like may be there are better ways of accesing this groups.

Thanks!

Evertjan.

unread,
May 20, 2016, 7:08:15 AM5/20/16
to
"Fernando D. Bozzo" <fdb...@gmail.com> wrote on 20 May 2016 in
comp.lang.javascript:

> I do not know very well the origin of the new Usenet Groups like this
> one.

Usenet started operating on the internet in 1980
[while www, the World Wide Web, is 10 years younger!]
<https://en.wikipedia.org/wiki/Usenet>

This usenet newsgroup, comp.lang.javascript, is from 1996
<https://www.obscure.org/javascript/archives/msg00031.html>

Google Groups became operational in February 2001,
following Google's acquisition of Deja's Usenet archive.
Deja News had been operational since 1995.
<https://en.wikipedia.org/wiki/Google_Groups>

> How are created?

Read the wiki of Usenet above.

This group is about javascript,
not about Usenet in general,
so such Qs are OT.

> like this one.

Well, you should.
Message has been deleted

Fernando D. Bozzo

unread,
May 20, 2016, 8:23:12 AM5/20/16
to
El viernes, 20 de mayo de 2016, 13:08:15 (UTC+2), Evertjan. escribió:
> "Fernando D. Bozzo" wrote on 20 May 2016 in
Very thanks for the info!

Dr J R Stockton

unread,
May 21, 2016, 6:44:55 PM5/21/16
to
In comp.lang.javascript message <200520161157395202%timstreater@greenbee
.net>, Fri, 20 May 2016 11:57:39, Tim Streater
<timst...@greenbee.net> posted:

>
>Use a newsreader. On my Mac I use Thoth, but you could use Thunderbird.
>You then need a news feed. I get mine from news.individual.net (see
>their website at www.individual.net). It costs €10/year which I
>consider cheap. Other sites are free but are not necessarily well
>supported.

I find AIOE and Eternal-September to be perfectly satisfactory.
Moreover, it seems better not to send avoidable Euros to the .de region;
they have far too many already.


--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Merlyn Web Site < > - FAQish topics, acronyms, & links.


Scott Sauyet

unread,
May 22, 2016, 11:25:32 PM5/22/16
to
Fernando D. Bozzo wrote:

> I'm curious, but how are everybody here accessing this (or other) Usenet
> Newgroups online? Are there a "better" way that doing from Google
> Groups?

Several others have already answered this in the thread, and given
suggestions for their favorites. From home, I use Pan and eternal-
september, but from the locked-down corporate environments where I often
work, I end up with few options other than Google Groups. That's an
extremely unsatisfactory solution.

But if you search the web for "news-reader" and "USENET" you should find
plenty of alternatives to fit your OS and your budget.

-- Scott

Mel Smith

unread,
May 24, 2016, 6:03:58 PM5/24/16
to
> Fernando D. Bozzo wrote:
>
>> I'm curious, but how are everybody here accessing this (or other) Usenet
>> Newgroups online? Are there a "better" way that doing from Google
>> Groups?

I use news.individual.net from the Free University of Berlin. Cost is ten
euros per year. Have used this USENET provider for years with absolutely no
complaints.

-Mel Smith


0 new messages