Linking Java Script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Friendly Indian

    Linking Java Script

    How can I include a 'link' to javascript in a web page so all the javascript
    code won't be readily accessible in the source view? I have a bit of code
    and would rather not include it. with the html code. Thanks.

    Friendly Indian


  • HikksNotAtHome

    #2
    Re: Linking Java Script

    In article <ZHmJb.103305$J W3.80589@twiste r.nyroc.rr.com> , "Friendly Indian"
    <newsgroup@plea se.com> writes:
    [color=blue]
    >How can I include a 'link' to javascript in a web page so all the javascript
    >code won't be readily accessible in the source view? I have a bit of code
    >and would rather not include it. with the html code. Thanks.[/color]

    <script type="text/javascript" src="URLToTheJS File.js"></script>

    It still doesn't stop any one with the slightest knowledge of the web or there
    browser to see your code.

    view-source: URLToTheJSFile. js in your address bar.
    --
    Randy

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Linking Java Script

      Friendly Indian wrote:
      [color=blue]
      > How can I include a 'link' to javascript in a web page so all the javascript
      > code won't be readily accessible in the source view? I have a bit of code
      > and would rather not include it. with the html code. Thanks.[/color]

      It depends on what you mean with "not include it". You *must*
      include *any* script code that should have the chance to work,
      only the methods of inclusion are different. You could use

      <head>
      ...
      <script src="$URI" type="text/javascript"></script>
      ...
      </head>

      to link an external script file containing the code.

      But doing this only for the purpose of obscurity is nonsense. People
      who want to get their hands on the code are usually smart enough to do
      so. (Those who do not want to type the URI in the Location Bar just use
      a bookmarklet.) The others are to stupid to re-use the code or simply
      do not care about it.

      Security by obscurity does not work. Your scripts are a work of mind
      and as such copyrighted by law in most countries. You should instead
      emphasize that fact (in a comment) and also include a license agreement
      that specifies to what extent your code can be modified, re-used, and
      distributed so that others can draw advantage from it or even can
      improve it (so if the code is good your name spreads throughout the
      hacker[1] community). See also: GNU General Public License (GPL).[2]


      PointedEars, IANAL
      ___________
      [1] Do not confuse hackers with crackers.
      The former build, the latter destroy.
      [2] http://www.gnu.org/licenses/licenses.html#GPL

      Comment

      • JustForPointedEars

        #4
        Re: Linking Java Script

        In article <4000F8E4.70407 00@PointedEars. de>, Thomas 'PointedEars' Lahn
        <PointedEars@we b.de> writes:
        [color=blue]
        >[1] Do not confuse hackers with crackers.
        > The former build, the latter destroy.[/color]

        Are you actually as stupid as you appear to be at times?
        --
        Randy

        Comment

        Working...