Help - Search - Members - Calendar
Full Version: What is "<javascript>" tag?
MSFN Forums > Coding, Scripting and Servers > Web Development (HTML, Java, PHP, ASP, XML, etc.)

   
Google Internet Forums Unattended CD/DVD Guide
YoussefGamil
Hi,
What does "<javascript>" written as a tag?Pls help me..
If I knew how does it work,It will be easy form me to create Socket Server.
prathapml
This is not to dis-courage you or something, but if you needed to ask this, then more likely than not, its going to take a long time before you learn it. Its not easy to teach the more basic things that we assume everyone knows, over the course of forum posts.
YoussefGamil
QUOTE (prathapml @ Feb 1 2005, 09:16 AM)
This is not to dis-courage you or something, but if you needed to ask this, then more likely than not, its going to take a long time before you learn it. Its not easy to teach the more basic things that we assume everyone knows, over the course of forum posts.

OH..NOO
Sorry for my crazy question...
but, all I want that how to use "<javascript>" to call java.net.SocketServer
in other meaning I want to use it because I do not want to use Java Applet.
What is difference between <script lanuage="JavaScript"> and <javascript> ?
and can it call Java function (ex: java.awt.*)
that's what you mean!!
realmad.gif Did you understand? realmad.gif
Alanoll
Javascript can't call java functions. They're not interconnected.

<javascript> isn't a valid HTML tag.
<script language"javascript"></script> is.
gamehead200
QUOTE (Alanoll @ Feb 1 2005, 03:25 PM)
Javascript can't call java functions. They're not interconnected.

<javascript> isn't a valid HTML tag.
<script language"javascript"></script> is.

That's exactly what I was thinking... There is no such thing as a <javascript> tag...
YoussefGamil
QUOTE (gamehead200 @ Feb 1 2005, 04:33 PM)
QUOTE (Alanoll @ Feb 1 2005, 03:25 PM)
Javascript can't call java functions. They're not interconnected.

<javascript> isn't a valid HTML tag.
<script language"javascript"></script> is.

That's exactly what I was thinking... There is no such thing as a <javascript> tag...

I was searching for this and I belived that there is not any tag
called "<javascript>".
But,..Infact I found a document in other forum
talking about this tag and using it to make a connection
with a Socket Server...This can help me to make something
like chat!! blink.gif
Take a look at this simple code:
--------------------------------------------
CODE
<category>=0A=
<pattern>WHAT DOES * MEAN</pattern>=0A=
<template>=0A=
<javascript>=0A=
<![CDATA[=0A=
    word =3D new =
String(Packages.org.alicebot.server.core.Graphmaster.INPUT_STAR);

    if (word.indexOf(" ") > 0)
 word =3D word.substr(0, word.indexOf(" "));

    retStr =3D "No definitions found for: '" + word + "'";
    server =3D "dict.org";=0A=
    port =3D 2628;
    socket =3D new java.net.Socket(server,port);=0A=
    socket.setKeepAlive(true);=0A=
    socket.setSoTimeout(5000);
    outBuff =3D new java.lang.StringBuffer();=0A=
    lineIn =3D new java.lang.String();=0A=
    inReader =3D new java.io.InputStreamReader(socket.getInputStream());=0A=
    response =3D new java.io.BufferedReader(inReader);
    cmdOut =3D new java.io.PrintWriter(socket.getOutputStream(), true);=0A=
    cmdOut.println("define * " + word + "\n");
    lineIn =3D response.readLine();

    if (lineIn.startsWith("220") =3D=3D false)
    {
 if (lineIn.startsWith("420"))
     retStr +=3D ".<br />Server temporarily unavailable!<br />";
 else
     if (lineIn.startsWith("421"))
   retStr +=3D ". <br />Server shutting down at operator request!<br =
/>";
     else
   retStr +=3D ".<br />Cannot access dictionary or server access =
denied!<br />";
    }
    else
    {
 lineIn =3D response.readLine();

 if (lineIn.startsWith("150")=3D=3D true)
 {
     while ((lineIn =3D response.readLine()) !=3D null)
     {
   if (lineIn.startsWith("151"))
   {
       x =3D lineIn.indexOf(" ");
       x =3D lineIn.indexOf(" ", x+1);
       x =3D lineIn.indexOf(" ", x+1);
       outBuff.append("From: "+ lineIn.slice(x) + "<br /><br />");
       continue;
   }

   if (lineIn.startsWith("250"))
       break;

   if (lineIn.startsWith("."))
   {=0A=
       if (lineIn.startsWith(".."))
     outBuff.append(lineIn.slice(1) + "<br />");

       continue;
   }

   if (lineIn.startsWith("."))
       continue;
       =0A=
   outBuff.append(lineIn + "<br />");=0A=
     }

     retStr =3D String(outBuff);
 }
 else
 {
     cmdOut.close();=0A=
     response.close();=0A=
     socket.close();
     socket =3D new java.net.Socket(server,port);=0A=
     socket.setKeepAlive(true);=0A=
     socket.setSoTimeout(5000);=0A=
     inReader =3D new java.io.InputStreamReader(socket.getInputStream());=0A=
     response =3D new java.io.BufferedReader(inReader);
     cmdOut =3D new java.io.PrintWriter(socket.getOutputStream(), true);=0A=
     cmdOut.println("match * . " + word + "\n");=0A=
     lineIn =3D response.readLine();

     if (lineIn.startsWith("220") =3D=3D false)
     {
   if (lineIn.startsWith("420"))
       retStr +=3D ".<br />Server temporarily unavailable!<br />";
   else
       if (lineIn.startsWith("421"))
     retStr +=3D ". <br />  Server shutting down at operator =
request!<br />";
       else
     retStr +=3D ".<br />  Server access denied!<br />";
     }
     else
     {
   lineIn =3D response.readLine();

   if (lineIn.startsWith("152")=3D=3D true)
   {
       while ((lineIn =3D response.readLine()) !=3D null)
       {=0A=
     if (lineIn.startsWith(".")) continue;=0A=
     if (lineIn.startsWith("250")) break;
     outBuff.append("<br />" + lineIn.slice(lineIn.indexOf(" ")));=0A=
       }

       retStr +=3D ", perhaps you mean:" + outBuff + "<br />";
   }
   else
   {
       if (lineIn.startsWith("552"))=0A=
     retStr +=3D ".";
       else
     if (lineIn.startsWith("550"))
         retStr +=3D ".<br /> Invalid dictionary match database!<br />";
     else=0A=
         if (lineIn.startsWith("551"))
       retStr +=3D ".<br /> Invalid dictionary match strategy!<br />";
   }
     }
 }

 cmdOut.println("QUIT\n");

 while ((lineIn =3D response.readLine()) !=3D null) =0A=
     if (lineIn.startsWith("221"))
   break;=0A=
    }

    cmdOut.close();=0A=
    response.close();=0A=
    socket.close();
    retStr;=0A=
]]>=0A=
</javascript>=0A=
</template>=0A=
</category>=0A=
matrix0978
hmmm..... i was never to believe that there was a <javascript> tag. well ive never seen or used it before...
YoussefGamil
QUOTE (matrix0978 @ Feb 3 2005, 09:44 AM)
hmmm..... i was never to believe that there was a <javascript> tag. well ive never seen or used it before...

OHH!!
I thought people in this forum knows alot of things..
like "<javascript>"!!
SO,where can I get the answer of my question? blushing.gif
Can any one help me,..PLEASE PLEASE confused.gif

--------------------------------
no.gif I have a good news..Cairo ICT will close tomorrow!!
matrix0978
We dont know everything newwink.gif

But i mean i guess its another way to call the script 'java' and it reads the script under those tags.
YoussefGamil
QUOTE (matrix0978 @ Feb 4 2005, 09:44 AM)
We dont know everything  newwink.gif

But i mean i guess its another way to call the script 'java' and it reads the script under those tags.

Iam VERY VERY SORRY blushing.gif .... "prathapml" made me nerves.
I did not mean to say that...take it easy...the world is full of jokes!! thumbup.gif
and here in Alexandria city people may say a bad words without understanding
it's effect on other people ....(be like MENA)
Iam returning back to school and I don't want to make any problem with any person
living in this earth.
I will be careful while getting out my words..and soory.


I have another question does the code (I wrote at the top) needs
a specially API to work with (in a website)?? Or It runs as a normal Javascript.
Stalkie
Sorry to disappoint you YoussefGamil, but that code looks like some Java that has run through a filter of some sort.

The =3D would seem to equal a = sign.
Also the <![CDATA[ would suggest XML.

So in conclusion, I would say:
It's an XML-document with a java code-snippet.
The <javascript>-tag is a home-made tag, and not valid in (X)HTML.
YoussefGamil
QUOTE (Stalkie @ Feb 21 2005, 03:02 AM)
Sorry to disappoint you YoussefGamil, but that code looks like some Java that has run through a filter of some sort.

The =3D would seem to equal a = sign.
Also the <![CDATA[ would suggest XML.

So in conclusion, I would say:
It's an XML-document with a java code-snippet.
The <javascript>-tag is a home-made tag, and not valid in (X)HTML.
*


Relly!!
I know nothing about XML!
when I need it..I will learn it.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.