Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Re: PHP


Message #1 by "Mr Data" <mrdata@i...> on Fri, 20 Apr 2001 16:00:49
I think your need can only be met in a situation where the clientcode (your 
javascript) can quickly access files from an intranet shared source system. The 
only way your include function is able to ?know? which file it should include 
is by getting it from an include itself. That consumes twice as many cycles. 
Not good. But these are usually slower than cheap service providers, who by the 
way can serve your files way more efficiently from their wide piped system. If 
there's cash I'd rather upgrade the internal file serving (maybe to the web?) 
capacity and install a php supporting webserver for serverscripting from the 
source, which is what it does best and is preferable seen in most ways...

Therefore you should consider the scope of your experiment and choose a 
solution. I recommend you try to master php (which I am just starting with), 
which is a very powerful and easily understandable. Here's the alternative 
(which is only interesting from a javascript autorial view I think):

You can do something with the filesystem thru javascript I believe....I think 
javascript has the functionality to do it, but i remember it was never given 
full file access because of the security standarts aimed at in 
browserdevelopment. But reading files should not be a problem, and that's all 
you need if I understand your comparison to php's include correctly...
Of course you can get half satisfaction by just using html's <include> for 
a .js file when you are thinking to include functions instead of other files...

I hope you are helped by this...

mrdata@i...


> Hello,
> 
> I need to make a "function JS_include()" with JavaScript based on the
> "include" function of PHP :
> 
> 	<?PHP
> 		include($page);
> 	?>
> 
> Thanks, Gérald P.
> 
> geraldp@w...

  Return to Index