Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local scripts

Status
Not open for further replies.

Diancecht

Programmer
Jan 8, 2004
4,042
ES
Please, please, don't burn me, don't send me to he hell of website designers.

I have a large web application designed to be used by a large number of people whose LAN access is very slow. One thing we thought is change the application and make all references to javascript point to the local hard drive, and distribute them manually.

I know it sounds really awful but, appart from the idea of a user modifying the script, I cannot fin a tecnical reason to say "no".

Am I missing something? Is there any security issue I'm not aware of? Any commens would be wellcome.

Cheers,
Dian
 
Modifying or updating a script put in who know HOW many places would be a nightmare.

How big is the Javascript file you're talking about? If it's only a couple K, then it's smaller than most small graphics. Is there a way to optimize and trim the amount of code in the web application itself, or optimize scripting speed with unrolling loops or something like that?

Lee
 
When you say make all references point to the local hard drive, do you mean to a .js file that is stored on the hard drive, or have the javascript access data from the hard drive?

If it is the former, then there shouldn't be an issue with storing it on their drive (except like you said: them changing the code - or moving the file / getting rid of the file completely).

If it is the latter - then you are going to be restricted to using ActiveX to access their disk data - which of course means IE only.

One thing that should probably be said though if we're talking about situation #1 - when you store javascript in an external .js file it is cached by the user's system. They will only have to download it once - the first visit to the page. I don't really know that storing it on the users' computers will net you much of a speed increase, or relieve much stress on your server. In all actuality, it will probably be much more of a pain for you to distribute the file, field helpdesk calls for people that have screwed with the file, etc than it would be to just import it off the server once and let the browser's cache take care of the rest.

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Hi trollacious, thanks for the reply

Well, the idea is modify the scripts just once and then distribute them via a CD or something like that, that process would be automatic.

We're talking about a couple MBs of scripts. I cannot even think on the nightmare of optimizing the whole monster. I know there should be no problem on setting the graphics as local files, but I'm a little concerned about the scripts.

Cheers,
Dian
 
You can test for yourself to see that it works:

somepage.html
Code:
<script type="text/javascript" src="c:\blah.js"></script>
<body onload="blah()"></body>

c:\blah.js
Code:
function blah() {
   alert("blah");
}

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Hi kaht, thanks for your reply.

This is one of the things I've always loved from tek-tips: you don't have time to write replies before other appears :)

It's first case: the scripts will be in the hard drive. The access to data itself, as you said, is resolved with applets and ActiveX controls and yes, it's and only IE solution.

And the problem with cache is the computer settings erase the case everytime the browser closes for security reasons, so no chance.

I guess that if there are no security risks, we''l go with this. If the user whats to modify the scripts, well, better for him not to complain if the application fails :)

Cheers,
Dian
 
Hi again kaht.

I did the test and it works, to my surprise I must admit.

Cheers,
Dian
 
[purple]Glad you got it workin[/purple]

[wink]

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top