Connecting Tech Pros Worldwide Help | Site Map

Thoughts on

  #1  
Old July 23rd, 2005, 12:22 PM
Ian
Guest
 
Posts: n/a
Hi there,

I wanted to get anybodys thoughts on using the following...

<script src="http://test.com/myscript.js"></script>

for including functions etc in the html page, of course I could embed all
the functions but wondered if anybody thinks that this is a more organised
way or should I stay clear and always insert the function of javascript
directly into the html

Any thoughts?

Ian


  #2  
Old July 23rd, 2005, 12:22 PM
Ivo
Guest
 
Posts: n/a

re: Thoughts on


"Ian" wrote[color=blue]
> I wanted to get anybodys thoughts on using the following...
>
> <script src="http://test.com/myscript.js"></script>
>
> for including functions etc in the html page, of course I could embed all
> the functions but wondered if anybody thinks that this is a more organised
> way or should I stay clear and always insert the function of javascript
> directly into the html
>
> Any thoughts?[/color]

Should I buy apples or pears? As so often, it depends. Each separate file
takes its size plus a bit (the making of the request) to download, so
keeping the number of files to a minumum is good. But if code is used on
multiple pages, it is better to allow browsers to make use of their caches
(it 's what they 're for), repeatedly downloading the same thing is foolish
of course.
If you can do serverside includes, maintaining code that is included in each
page can be done centrally, otherwise there might be an extra argument for
..js files.
HTH
Ivo


  #3  
Old July 23rd, 2005, 12:22 PM
Ian
Guest
 
Posts: n/a

re: Thoughts on


thanks for the reply!

Ah server side includes, meaning that the Client Javascript is inserted on
the server before it is sent to the client?? Is this correct?

I am using asp.net C# ... any ideas how to use server side includes to
insert the client javascript?

Thanks

Ian


"Ivo" <no@thank.you> wrote in message
news:40bef3cc$0$1737$abc4f4c3@news.wanadoo.nl...[color=blue]
> "Ian" wrote[color=green]
> > I wanted to get anybodys thoughts on using the following...
> >
> > <script src="http://test.com/myscript.js"></script>
> >
> > for including functions etc in the html page, of course I could embed[/color][/color]
all[color=blue][color=green]
> > the functions but wondered if anybody thinks that this is a more[/color][/color]
organised[color=blue][color=green]
> > way or should I stay clear and always insert the function of javascript
> > directly into the html
> >
> > Any thoughts?[/color]
>
> Should I buy apples or pears? As so often, it depends. Each separate file
> takes its size plus a bit (the making of the request) to download, so
> keeping the number of files to a minumum is good. But if code is used on
> multiple pages, it is better to allow browsers to make use of their caches
> (it 's what they 're for), repeatedly downloading the same thing is[/color]
foolish[color=blue]
> of course.
> If you can do serverside includes, maintaining code that is included in[/color]
each[color=blue]
> page can be done centrally, otherwise there might be an extra argument for
> .js files.
> HTH
> Ivo
>
>[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thoughts on throwing exceptions vs putting them on a property GG answers 5 September 5th, 2006 09:05 PM
Some thoughts on VB9 Justin Weinberg answers 35 March 4th, 2006 07:45 AM
Thoughts on Guido's ITC audio interview Dave Benjamin answers 24 July 21st, 2005 08:02 AM
Any thoughts on the differences between <span> & <div> layers? Timothy Casey answers 18 July 20th, 2005 11:46 PM