To answer some of your questions:

1) Should I think of it as just "ok, there are some .js scripts and in
the end they are put together in one big script and there all the
definitions are present"?

Yes, that how it works. The cook tool puts together a list of .js
files according to a recipe. The .js files were originally created by
splitting TiddlyWiki. Code was grouped together logically, but there
were too many interdependencies in the original TiddlyWiki to have
self contained .js files.

I can't make a good suggestion for a jQuery intro. I can answer about
the odd looking constructions, such as:
$(function() {
// jquery goes here
});

These are because javascript is a function scoped, rather than a block
scoped language, so to constrain the scope of variables you need to
wrap them in a dummy function. In a block scoped language, you would
just wrap the variables in a block (ie {...} or BEGIN...END).

Martin


On 9 August 2011 21:53, Yakov <[email protected]> wrote:
> Hello.
>
> I have two basic questions which rised when I tried to understand the
> core code for the second time.
>
> 1. main.js contains functions which are not defined there (for
> instance, displayMessage). How JavaScript processor understands where
> to find thos functions? Should I think of it as just "ok, there are
> some .js scripts and in the end they are put together in one big
> script and there all the definitions are present" or there's some more
> structure in this? I guess this is something to do with the
> "recipes"..
>
> 2. There's Eric's insideTW which allows to track dependencies and to
> see what is included in the each .js piece; but what it has to do with
> those recipes? Also, the code in [1] and [2] slightly differs (for
> instance, main in [1] begins as
>
> function main()
>
> and in the [2] as
>
> main =function main()
>
> ) -- is it some sort of automatic reprocessing and everything is
> syncronized nonetheless?
>
>
> Also, can anyone suggest a good intro for reading scripts with jQuery
> usage (rather than writing; I mean those
>
> $(function() {
> // jquery goes here
> });
>
> and other "strange" constructions)?
>
> [1] http://svn.tiddlywiki.org/Trunk/core/js/main.js
> [2] http://www.tiddlytools.com/insideTW/#main
>
> --
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/tiddlywikidev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to