473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

javascript on the server side

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,

Jul 23 '05 #1
2 1247
Lee
Cortes said:
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?


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.

Jul 23 '05 #2

"Lee" <RE**************@cox.net> wrote in message
news:c9*********@drn.newsguy.com...
Cortes said:
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?


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.

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??
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, thanks for your help yesterday, I've got one more question, then I think I'm done for now,... Is it possible to insert recordset data in a javascript, for instance I have a javascript...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.