Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What is "<javascript>" tag?

Featured Replies

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.


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.

  • Author
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:

Javascript can't call java functions. They're not interconnected.

<javascript> isn't a valid HTML tag.

<script language"javascript"></script> is.

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...

  • Author
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=

hmmm..... i was never to believe that there was a <javascript> tag. well ive never seen or used it before...

  • Author
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!!

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.

  • Author
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.

  • 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.

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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.