external javascripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • daniel kaplan

    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


  • Ivo

    #2
    Re: external javascripts

    "daniel kaplan" wrote[color=blue]
    > very new to this (javascript and the likes) so this might range in the[/color]
    dumb[color=blue]
    > 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[/color]
    the[color=blue]
    > JS files at? i.e as in Perl scripts should be 755...[/color]

    The files should at least be world readable.
    --
    Ivo


    Comment

    • David Dorward

      #3
      Re: external javascripts

      daniel kaplan wrote:
      [color=blue]
      > what is the proper permissions to set the
      > JS files at? i.e as in Perl scripts should be 755.[/color]

      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

      Comment

      • daniel kaplan

        #4
        Re: external javascripts

        "Ivo" <no@thank.you > wrote in message
        news:41a50b6d$0 $41218$cd19a363 @news.wanadoo.n l...
        [color=blue]
        > The files should at least be world readable.[/color]


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

        i have a function in javascript, works beutifully....n othing 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="JavaS cript" SRC="FULLPATHNA ME"></SCRIPT>

        then the browser hits me with :

        Error: Object Expected...on the line where i call the function....doe sn'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="JavaS cript">
        function SetCookie (name, value)
        {
        var argv = SetCookie.argum ents;
        var argc = SetCookie.argum ents.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.toGMTSt ring())) +
        ((path == null) ? "" : ("; path=" + path)) +
        ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
        }
        </SCRIPT>

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

        but the moment i replace the sourcecode with

        <SCRIPT language="JavaS cript"
        SRC="http://www.mywebsiteex maple.com/cgi-bin/jsSetCookie.js" ></SCRIPT>

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


        Comment

        • Grant Wagner

          #5
          Re: external javascripts

          daniel kaplan wrote:
          [color=blue]
          > "Ivo" <no@thank.you > wrote in message
          > news:41a50b6d$0 $41218$cd19a363 @news.wanadoo.n l...
          >[color=green]
          > > The files should at least be world readable.[/color]
          >
          > perhaps you'll allow me to ask a follow up?
          >
          > i have a function in javascript, works beutifully....n othing 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="JavaS cript" SRC="FULLPATHNA ME"></SCRIPT>
          >
          > then the browser hits me with :
          >
          > Error: Object Expected...on the line where i call the function....doe sn'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="JavaS cript">
          > function SetCookie (name, value)
          > {
          > var argv = SetCookie.argum ents;
          > var argc = SetCookie.argum ents.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.toGMTSt ring())) +
          > ((path == null) ? "" : ("; path=" + path)) +
          > ((domain == null) ? "" : ("; domain=" + domain)) +
          > ((secure == true) ? "; secure" : "");
          > }
          > </SCRIPT>
          >
          > then this works! <body onload="SetCook ie('IsCrumb', 'true');"
          > bgcolor="#EEEEF F" text="#000000" link="#0000FF" vlink="#660033"
          > background="">
          >
          > but the moment i replace the sourcecode with
          >
          > <SCRIPT language="JavaS cript"
          > SRC="http://www.mywebsiteex maple.com/cgi-bin/jsSetCookie.js" ></SCRIPT>
          >
          > the error occurs....!!!!! !![/color]

          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 <gwagner@agrico reunited.com>
          comp.lang.javas cript FAQ - http://jibbering.com/faq

          Comment

          • daniel kaplan

            #6
            Re: external javascripts

            "daniel kaplan" <nospam@nospam. com> wrote in message
            news:1101343052 .756455@nntp.ac ecape.com...[color=blue]
            > "Ivo" <no@thank.you > wrote in message
            > news:41a50b6d$0 $41218$cd19a363 @news.wanadoo.n l...
            >
            >
            > i have a function in javascript, works beutifully....n othing more than
            > setting a cookie....when the script is laid out in the head of the html,[/color]
            all[color=blue]
            > 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="JavaS cript" SRC="FULLPATHNA ME"></SCRIPT>
            >
            > then the browser hits me with :
            >
            > Error: Object Expected...on the line where i call the function....doe sn't
            > matter what the permissions are....and the file is saved in pure text,[/color]
            with[color=blue]
            > the extention 'js'.....any ideas?[/color]

            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.....


            Comment

            • daniel kaplan

              #7
              Re: external javascripts

              "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
              news:41A5EBA5.F BCA26CF@agricor eunited.com...[color=blue]
              > daniel kaplan wrote:
              >[/color]
              [color=blue]
              > Do you remove the <SCRIPT ...> </SCRIPT> tags when you move the code into[/color]
              the[color=blue]
              > external js file?[/color]

              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


              Comment

              Working...