473,387 Members | 3,750 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,387 software developers and data experts.

external javascripts

hi all,

very new to this (javascript and the likes) so this might range in the dumb
cataegory. when i am saving my external javascripts on the same server as
all my HTML and Perl, etc scripts, what is the proper permissions to set the
JS files at? i.e as in Perl scripts should be 755...

thanks ahead,

daniel
Jul 23 '05 #1
6 1443
Ivo
"daniel kaplan" wrote
very new to this (javascript and the likes) so this might range in the dumb cataegory. when i am saving my external javascripts on the same server as
all my HTML and Perl, etc scripts, what is the proper permissions to set the JS files at? i.e as in Perl scripts should be 755...


The files should at least be world readable.
--
Ivo
Jul 23 '05 #2
daniel kaplan wrote:
what is the proper permissions to set the
JS files at? i.e as in Perl scripts should be 755.


JavaScript is run client side, so you need whatever permissions are needed
for your httpd to read the .js file. At a minimum this will be 400.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3
"Ivo" <no@thank.you> wrote in message
news:41***********************@news.wanadoo.nl...
The files should at least be world readable.

perhaps you'll allow me to ask a follow up?

i have a function in javascript, works beutifully....nothing more than
setting a cookie....when the script is laid out in the head of the html, all
is cool! in the body section i just do an onload...and eveything works...

but when i move the function source to my server and replace it with

<SCRIPT language="JavaScript" SRC="FULLPATHNAME"></SCRIPT>

then the browser hits me with :

Error: Object Expected...on the line where i call the function....doesn't
matter what the permissions are....and the file is saved in pure text, with
the extention 'js'.....any ideas?

thanks ahead (code follows below)

when i have this in the head:

<SCRIPT LANGUAGE="JavaScript">
function SetCookie (name, value)
{
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
</SCRIPT>

then this works! <body onload="SetCookie('IsCrumb', 'true');"
bgcolor="#EEEEFF" text="#000000" link="#0000FF" vlink="#660033"
background="">

but the moment i replace the sourcecode with

<SCRIPT language="JavaScript"
SRC="http://www.mywebsiteexmaple.com/cgi-bin/jsSetCookie.js"></SCRIPT>

the error occurs....!!!!!!!
Jul 23 '05 #4
daniel kaplan wrote:
"Ivo" <no@thank.you> wrote in message
news:41***********************@news.wanadoo.nl...
The files should at least be world readable.


perhaps you'll allow me to ask a follow up?

i have a function in javascript, works beutifully....nothing more than
setting a cookie....when the script is laid out in the head of the html, all
is cool! in the body section i just do an onload...and eveything works...

but when i move the function source to my server and replace it with

<SCRIPT language="JavaScript" SRC="FULLPATHNAME"></SCRIPT>

then the browser hits me with :

Error: Object Expected...on the line where i call the function....doesn't
matter what the permissions are....and the file is saved in pure text, with
the extention 'js'.....any ideas?

thanks ahead (code follows below)

when i have this in the head:

<SCRIPT LANGUAGE="JavaScript">
function SetCookie (name, value)
{
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
</SCRIPT>

then this works! <body onload="SetCookie('IsCrumb', 'true');"
bgcolor="#EEEEFF" text="#000000" link="#0000FF" vlink="#660033"
background="">

but the moment i replace the sourcecode with

<SCRIPT language="JavaScript"
SRC="http://www.mywebsiteexmaple.com/cgi-bin/jsSetCookie.js"></SCRIPT>

the error occurs....!!!!!!!


Do you remove the <SCRIPT ...> </SCRIPT> tags when you move the code into the
external js file?

Also, the language attribute is deprecated, use <script type="text/javascript">
instead.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #5
"daniel kaplan" <no****@nospam.com> wrote in message
news:11***************@nntp.acecape.com...
"Ivo" <no@thank.you> wrote in message
news:41***********************@news.wanadoo.nl...
i have a function in javascript, works beutifully....nothing more than
setting a cookie....when the script is laid out in the head of the html, all is cool! in the body section i just do an onload...and eveything works...

but when i move the function source to my server and replace it with

<SCRIPT language="JavaScript" SRC="FULLPATHNAME"></SCRIPT>

then the browser hits me with :

Error: Object Expected...on the line where i call the function....doesn't
matter what the permissions are....and the file is saved in pure text, with the extention 'js'.....any ideas?


so i was told that netscape has much better debugging features for
circumsstances like this...so i downloaded it, and it runs it
perfectly....so i went back to IE and turned all privacy and all security
features to as LOW as i coudl set them...and still! IE gives me the
error...

now i am even more stumped.....
Jul 23 '05 #6
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:41***************@agricoreunited.com...
daniel kaplan wrote:
Do you remove the <SCRIPT ...> </SCRIPT> tags when you move the code into the external js file?


yes, it is JUST the fucntion

and now based on yoru recommendation i tried it with : <script
type="text/javascript">

still same error....

i have sat there and poured over the path again and again to make sure i
made it right....but if you look at the follow up post i made minutes before
your hit, you'll see that it ALWAYS works in NETSCAPE!

still puzzled,

daniel
Jul 23 '05 #7

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

Similar topics

3
by: Kerberos | last post by:
When I deliver a page as text/html, the javascripts work, but if delivered as application/xhtml+xml, the javascripts don't work: function OpenBrWindow(theURL,winName,features, myWidth, myHeight,...
1
by: John B. | last post by:
In an effort to turn a little more a module with my pages, I would like to turn my internal javascripts into an external javascript files to supply the information onto a web page. I...
4
by: Smoke | last post by:
We had a javascript calling a Cold Fusion page (.cfm) and it was working for 2 years. Suddenly yesterday or today its decided it doesn't want to work anymore. I'm picking up somebody elses code I...
2
by: sdvoranchik | last post by:
We have an application that contains links that run javascripts to create pages in a separate frame. When these links open an external site, it causes the javascripts to no longer function. When...
2
by: LC's No-Spam Newsreading account | last post by:
I asked a couple of days ago about the following arrangement (simplified). I made some progress using netscape.security.PrivilegeManager.enablePrivilege but still have to ask some further help. ...
4
by: David Virgil Hobbs | last post by:
My web host inserts banner ads into my html pages. The javascript in these banner ads interferes with the onload triggered javascript functions in my pages. Whether I trigger my javascript...
1
by: Chuck Mendell | last post by:
I am having problem with external javascripts. My OS is XP Pro. I am told to create an external javascript using a .js extension. (I did that) The external .js is very simple, containing: ...
38
by: Neo Geshel | last post by:
I am seeking a method to load one JS file directly into another, *without* having to dynamically write <scripttags. Is there any method whereby I can call only one external JS file using a ...
4
by: januarynow | last post by:
Generally, my site contains javascripts (a couple of freebie counters plus some CPM (pay-per-impression) and CPC (pay-per-click) ads), from four different firms, but they are all suffering from the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.