Jump to content

What is "<javascript>" tag?


Recommended Posts


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.

Link to comment
Share on other sites

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: Did you understand? :realmad:

Link to comment
Share on other sites

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:

Take a look at this simple 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=

Link to comment
Share on other sites

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:

Can any one help me,..PLEASE PLEASE :}

--------------------------------

:no: I have a good news..Cairo ICT will close tomorrow!!

Link to comment
Share on other sites

We dont know everything  ;)

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: .... "prathapml" made me nerves.

I did not mean to say that...take it easy...the world is full of jokes!! :thumbup

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.

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...