Simple Java Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Youness Alma
    New Member
    • Aug 2011
    • 5

    Simple Java Question

    This is example of my page:
    Code:
    <html>
    <head>
    <JAVA>
    </JAVA> 
    <title> my title </title>
    </head>
    <body>
    </body>
    </html>
    Ok. I can only add java script codes in block <JAVA> and </JAVA>
    I add this code in above block:
    <script type='text/javascript' src='external script url' ></script>
    I want this basic script don’t run in JAVA block ( <JAVA> ) and I call it in body
    How can I simply call this basic code in body tag? (I can't add java script codes in body)
    Last edited by Dormilich; Aug 31 '11, 12:19 PM. Reason: please use [CODE] [/CODE] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you can’t. <java> is an invalid/unknown HTML tag, hence nothing will happen. to execute JavaScript code use the aforementioned <script> tags.

    Comment

    • Youness Alma
      New Member
      • Aug 2011
      • 5

      #3
      <java> isn’t my tag, this is an example.
      I want call my scripts that are in <script> tags, to run in another place. can u understand my language?! I can't type English correctly!

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        I want call my scripts that are in <script> tags, to run in another place.
        won’t work. if you want to run a script, use <script> tags. period.

        PS. English ain’t my mother tongue either

        Comment

        • Youness Alma
          New Member
          • Aug 2011
          • 5

          #5
          Can't I use function rule?
          Please learn me.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            what is function rule?

            Comment

            • Youness Alma
              New Member
              • Aug 2011
              • 5

              #7
              View this: http://www.w3schools.com/js/js_functions.asp

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                that’s JavaScript. and JavaScript only works from <script> tags.

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  To expand a bit, JavaScript is not Java.

                  Comment

                  Working...