Connecting Tech Pros Worldwide Help | Site Map

javascript on the server side

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

I've written a *utility* Javascript that I want to make available to many of
my friends.

All you have to do is to insert some code i wrote in the header.
However, this piece of Javascript uses some other script which is large.
That is

<script src = "./js/tmp.js".....>

This will work if the file "tmp.js" is local. However this reduces the
portability of my *utility* Javascript
as users have to have that "tmp.js" for every webpage they have (if they
want to use it :D)

I thought of uploading "tmp.js" it to somewhere and change my code to

<script src = http://www.somewhere.com/js/tmp.js ....>

The all the users have to do is copy the piece of code that I wrote
BUT THIS DOES NOT WORK. I TRIED IT.

My questions are:
1. Is there something wrong with server-side Javascript? Or am I missing
something?
2. Is there another way to make my code portable?


Cheers,



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

re: javascript on the server side


Cortes said:
[color=blue]
>I thought of uploading "tmp.js" it to somewhere and change my code to
>
><script src = http://www.somewhere.com/js/tmp.js ....>
>
>The all the users have to do is copy the piece of code that I wrote
>BUT THIS DOES NOT WORK. I TRIED IT.
>
>My questions are:
>1. Is there something wrong with server-side Javascript? Or am I missing
>something?[/color]

That's not what's called "server-side" Javascript.
It executes on the client's machine.

What you've done should work, if you do it correctly:

<script src="http://www.somewhere.com/js/tmp.js"></script>

If it "does not work", it would help to know how it failed.
What error messages did you see? What, exactly, didn't work?

Are you absolutely sure you've got the path correct?
You should be able to type:

view-source:http://www.somewhere.com/js/tmp.js

in the Location text field of your browser and see the contents
of your file.

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

re: javascript on the server side



"Lee" <REM0VElbspamtrap@cox.net> wrote in message
news:c9mach01th8@drn.newsguy.com...[color=blue]
> Cortes said:
>[color=green]
> >I thought of uploading "tmp.js" it to somewhere and change my code to
> >
> ><script src = http://www.somewhere.com/js/tmp.js ....>
> >
> >The all the users have to do is copy the piece of code that I wrote
> >BUT THIS DOES NOT WORK. I TRIED IT.
> >
> >My questions are:
> >1. Is there something wrong with server-side Javascript? Or am I missing
> >something?[/color]
>
> That's not what's called "server-side" Javascript.
> It executes on the client's machine.
>
> What you've done should work, if you do it correctly:
>
> <script src="http://www.somewhere.com/js/tmp.js"></script>
>
> If it "does not work", it would help to know how it failed.
> What error messages did you see? What, exactly, didn't work?
>
> Are you absolutely sure you've got the path correct?
> You should be able to type:
>
> view-source:http://www.somewhere.com/js/tmp.js
>
> in the Location text field of your browser and see the contents
> of your file.
>[/color]


Thanks Lee

Yes Im positive the path is correct because I tried , more than once, to
copy and paste the path and I got the actual
content of the file "tmp.js"

What I used is when poping up the child window, this child window then will
use the file "tmp.js"
Normally, with local path, the child pops up and *kicks* ... well :). But
when I use the "http://..." remote path the child is just like blank and
seems not responding. You can't right click, you see blank and you can only
close it. :(

I wasn't exactly sure whether or not that is server-side scripting, are you
saying that the file "tmp.js" will be copied to local machine before it
executes?

The file "tmp.js" is something I reuse from somebody else, so I wonder if i
have to change it so that it can be "remotely" called??


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close a Form on Server Side! Vai2000 answers 1 December 8th, 2006 03:45 PM
Open new browser window on server side button click shil answers 6 November 19th, 2005 10:49 PM
Collectiong Data on Server side while adding rows on client side Sileesh answers 0 November 18th, 2005 09:53 PM
Detect JavaScript Enabled and cokies on SERVER SIDE oreng answers 1 November 18th, 2005 02:39 PM
Delaying on server side Agoston Bejo answers 21 July 22nd, 2005 02:46 AM