XP access to .js?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chuck Mendell

    XP access to .js?

    Hi,
    I am told to form an external javascript, so I form a text file and end
    it with .js. (jxt1.js) This script is very simple:
    function a_message()
    {
    alert('I came from an external script! Ha, Ha, Ha!!!!');
    }
    Next, I form a HTML page which is supposed to access that external .js!
    Between the heads, I type:
    <SCRIPT language="JavaS cript" SRC="jxt1.js"></SCRIPT>

    So, I'm supposed to be all set up. When I access the page, nothing happens.
    When I click on the script.js, to see it and edit it, nothing happens. My
    question is how do i run an external javascript and click on it to view and
    edit it when my OS is XP Pro? I know this seems very basic but please
    answer.


  • John Bokma

    #2
    Re: XP access to .js?

    "Chuck Mendell" <chuck@chuckmen dell.741.com> wrote in
    news:vBc9d.5259 3$Si.48875@torn ado.tampabay.rr .com:
    [color=blue]
    > Hi,
    > I am told to form an external javascript, so I form a text file
    > and end
    > it with .js. (jxt1.js) This script is very simple:
    > function a_message()
    > {
    > alert('I came from an external script! Ha, Ha, Ha!!!!');
    > }
    > Next, I form a HTML page which is supposed to access that external
    > .js! Between the heads, I type:
    > <SCRIPT language="JavaS cript" SRC="jxt1.js"></SCRIPT>
    >
    > So, I'm supposed to be all set up. When I access the page, nothing
    > happens. When I click on the script.js, to see it and edit it, nothing
    > happens. My question is how do i run an external javascript and click
    > on it to view and edit it when my OS is XP Pro? I know this seems very
    > basic but please answer.[/color]

    Did you call a_message somewhere?....


    --
    John MexIT: http://johnbokma.com/mexit/
    personal page: http://johnbokma.com/
    Experienced programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html

    Comment

    • George Hester

      #3
      Re: XP access to .js?


      "John Bokma" <postmaster@cas tleamber.com> wrote in message news:Xns957B67D 3E4411castleamb er@130.133.1.4. ..[color=blue]
      > "Chuck Mendell" <chuck@chuckmen dell.741.com> wrote in
      > news:vBc9d.5259 3$Si.48875@torn ado.tampabay.rr .com:
      > [color=green]
      > > Hi,
      > > I am told to form an external javascript, so I form a text file
      > > and end
      > > it with .js. (jxt1.js) This script is very simple:
      > > function a_message()
      > > {
      > > alert('I came from an external script! Ha, Ha, Ha!!!!');
      > > }
      > > Next, I form a HTML page which is supposed to access that external
      > > .js! Between the heads, I type:
      > > <SCRIPT language="JavaS cript" SRC="jxt1.js"></SCRIPT>
      > >
      > > So, I'm supposed to be all set up. When I access the page, nothing
      > > happens. When I click on the script.js, to see it and edit it, nothing
      > > happens. My question is how do i run an external javascript and click
      > > on it to view and edit it when my OS is XP Pro? I know this seems very
      > > basic but please answer.[/color]
      >
      > Did you call a_message somewhere?....
      >
      >
      > --
      > John MexIT: http://johnbokma.com/mexit/
      > personal page: http://johnbokma.com/
      > Experienced programmer available: http://castleamber.com/
      > Happy Customers: http://castleamber.com/testimonials.html[/color]

      In the js you have and only:

      function a_message()
      {
      alert('I came from an external script! Ha, Ha, Ha!!!!');
      }

      In your html you have:

      <!-- testjs.htm -->
      <html>
      <head>
      <script language="JavaS cript" src="jxt1.js"></script>
      </head>
      <body>
      <script language="Javas cript">
      a_message();
      </script>
      </body>
      </html>

      Both located in the same area. Then you browse to testjs.htm.

      George Hester
      _______________ _______________ ____

      Comment

      • Charles Mendell

        #4
        Re: XP access to .js?


        Thanks John and George. Sometimes you can't see the forest through the
        trees. Of course I didn't call it. To view/edit the .js, all I had to do
        was right-click the .js file and "always open with" (textpad.exe)

        I can now create a .js and pages that access that .js. That's all I
        wanted. I can obviously do the rest. Thanks!


        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Oscar Monteiro

          #5
          Re: XP access to .js?

          you miss to assign the onload event to thet function

          <body>
          <body onload = "a_message( )">
          </body>


          Comment

          Working...