YoussefGamil Posted February 1, 2005 Share Posted February 1, 2005 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. Link to comment Share on other sites More sharing options...
prathapml Posted February 1, 2005 Share Posted February 1, 2005 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 More sharing options...
YoussefGamil Posted February 1, 2005 Author Share Posted February 1, 2005 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..NOOSorry for my crazy question...but, all I want that how to use "<javascript>" to call java.net.SocketServerin 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!! Did you understand? Link to comment Share on other sites More sharing options...
Alanoll Posted February 1, 2005 Share Posted February 1, 2005 Javascript can't call java functions. They're not interconnected.<javascript> isn't a valid HTML tag.<script language"javascript"></script> is. Link to comment Share on other sites More sharing options...
gamehead200 Posted February 1, 2005 Share Posted February 1, 2005 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... Link to comment Share on other sites More sharing options...
YoussefGamil Posted February 3, 2005 Author Share Posted February 3, 2005 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 tagcalled "<javascript>".But,..Infact I found a document in other forumtalking about this tag and using it to make a connectionwith a Socket Server...This can help me to make somethinglike chat!! 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 More sharing options...
matrix0978 Posted February 3, 2005 Share Posted February 3, 2005 hmmm..... i was never to believe that there was a <javascript> tag. well ive never seen or used it before... Link to comment Share on other sites More sharing options...
YoussefGamil Posted February 3, 2005 Author Share Posted February 3, 2005 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? Can any one help me,..PLEASE PLEASE -------------------------------- I have a good news..Cairo ICT will close tomorrow!! Link to comment Share on other sites More sharing options...
matrix0978 Posted February 4, 2005 Share Posted February 4, 2005 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. Link to comment Share on other sites More sharing options...
YoussefGamil Posted February 4, 2005 Author Share Posted February 4, 2005 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 .... "prathapml" made me nerves.I did not mean to say that...take it easy...the world is full of jokes!! and here in Alexandria city people may say a bad words without understandingit's effect on other people ....(be like MENA)Iam returning back to school and I don't want to make any problem with any personliving 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) needsa specially API to work with (in a website)?? Or It runs as a normal Javascript. Link to comment Share on other sites More sharing options...
Stalkie Posted February 21, 2005 Share Posted February 21, 2005 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 More sharing options...
YoussefGamil Posted March 11, 2005 Author Share Posted March 11, 2005 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.<{POST_SNAPBACK}>Relly!!I know nothing about XML!when I need it..I will learn it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now