Re: Dynamic loading of javascript files into web pages



On Jun 29, 8:11 am, One Dumm Hikk <hikksnotath...@xxxxxxx> wrote:
On Jun 28, 9:57 pm, Jorge <jo...@xxxxxxxxxxxxxxxxx> wrote:
(...)
That f() must be a global and requires a previous, separate <script>.
Resig's solution requires none of these.

Pure nonsense. It doesn't have to be global nor does it
"require a previous, seperate <script>".
f() can be a property of a single global object and the call
can be made in the same file that you are loading. I know that
to be true because its the way I have been doing it for many
years now. Download a .js file that has data in it with a
function call at the end of the file that deals with the
data in the file.

Yes, the properties you attach to a global object are global too.
And yes, f() must have been declared somewhere (in a previous,
separate <script>) before calling it.

That is how you deal with the issue of
knowing when/if the file is downloaded or not. It is
the ONLY *reliable* way to know that the data file has
downloaded.

Perhaps you should search the c.l.j archives for
"dynamic script insertion" and spend the next two
weeks or so reading the many many threads on this
topic.

You mean, that perhaps, I'd find there something else that's not being
said here ?
A secret or something ?

On Jun 27, 10:30 am, Jorge <jo...@xxxxxxxxxxxxxxxxx> wrote:
On Jun 27, 3:49 am, One Dumm Hikk <hikksnotath...@xxxxxxx> wrote:
Dynamically loading script files to speed up the loading process?
Garbage.
What it will do, if done properly, is speed up the initial
rendering of the page. But it WON'T speed up load time of the
files and will actually slow it down. The reason it will
actually slow it down is because it has to do more work to
load the files. Whether the file is static coded or dynamically
loaded, the file still has to be downloaded from the server.
Want it to download faster? Make the file physically smaller.
Any other advice is magical hocus-pocus for making it load
faster if everything else is the same.
(...)
I'm not sure why do you say so, as it's obvious (isn't it ?) that
latency times add up when the scripts are loaded in series.

I say that because its patently true. Unless you want to try to
convince me that connection speed is determined by how the file
was attempted to be loaded. Again, take a HARD look at the original
script, how it was written, and how it would work. Then let's
discuss what it will or won't do.

<script>s hardcoded in the source .html halt parsing and download in
series, while dynamically inserted ones don't halt parsing and download
in parallel.

And that is precisely what I said. It doesn't change the download time
it
takes, it changes the rendering time to render an initial page so that
you fool the uneducated into thinking the page has finished "loading"
because they see content.

Now it looks like you're focusing on the "doesn't halt parsing" aspect
while conveniently forgetting about the "and download in parallel
(read: faster)" side of things.

Witness mySpace and its abominable use of
AJAX to try to "speed up" the site when in fact its a classic example
of the *wrong way* to speed up a site.

Has John Resig gotten any clue about JS in the last 18 months or so?
If he hasn't, then he still doesn't have a clue.

DM in disguise ?

That question, in and of itself, displays your level of knowledge
of what you are attempting to discuss. Try searching the archives
for the suggested search, read it all, and then get back to me.
Because as it stands now, your question shows that you have made
no effort to research the archives to find out about the subject
you are trying to portray yourself as an expert on.

How's posting code that proves what I say is pretending ?

I am not what I would consider an "expert" on the topic but I simply
have done a TON of research in the last 10 years or so on the topic
and a perusal of the archives would answer many of the questions you
are trying to - incorrectly - answer.

--
Randy Webb

--
Jorge.
.



Relevant Pages

  • Re: Dynamic loading of javascript files into web pages
    ... pattern" - it escapes me where the actual problem is, requesting such a ... after the script has loaded and executed. ... But it WON'T speed up load time of the ... Want it to download faster? ...
    (comp.lang.javascript)
  • Re: constant runtime errors-please help
    ... Common script errors messages can be eliminated by Clicking: ... click Internet Options. ... Two download versions are available for Windows Script 5.6. ... HiJackThis: - Free ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Idiot proof removal of junk?
    ... | I would like to send everyone a single script or small set of scripts ... | convince windows to boot into safe mode with command prompt. ... FireWall to allow it to download the needed AV vendor related files. ... This will bring up the initial menu of choices and should be executed in Normal Mode. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Dynamic loading of javascript files into web pages
    ... pattern" - it escapes me where the actual problem is, requesting such a ... Given a script that has not been loaded yet, ... But it WON'T speed up load time of the ... while dynamically inserted ones don't halt parsing and download in parallel. ...
    (comp.lang.javascript)
  • Announcement: Fix management tool for AIX 4.x/5.x available
    ... I'm pleased to announce a tool to automate download and management ... of ".bff" and ".rpm" fix packages for AIX ver. ... "fix-get.sh" script has been designed to automate fix packages ... discovery and download for servers with Unix AIX versions up to 5.3. ...
    (comp.unix.aix)

Loading