Re: javascript and server socket



giangiammy wrote:

I'd like to implement a server socket in java:

Java or JavaScript? Because they have only the first four letters in
common. <URL:http://jibbering.com/faq/>

something linke the following example.

The problem is that the HTML has not the permission to execute
instruction

HTML does not execute anything. It is a _markup_ language.

serverSocket =
Components.classes["@mozilla.org/network/server-socket;1"].
createInstance(Components.interfaces.nsIServerSocket);

This is script code, executed by the JavaScript engine.

Question:
1 - how do I give it this permisison?

The script can request permission, and it can (not: must) be given by the
user:

<URL:http://developer.mozilla.org/en/docs/Bypassing_Security_Restrictions_and_Signing_Code>

2 - one solution I thought was to put the javascript code in a firefox
extension, to load, so it should have all needed permisison, but,
How can I call a java script function define in an extension
^^^^^^^^^^^
Again, the language is named "JavaScript" for a reason.

from an html page? - there's some particular syntax?
[...]

AFAIK, you cannot. If you could, this would allow any foreign Web site
to trigger your extensions which do not run in the sandbox like the
client-side script code of the Web site. Surely you do not want that
to happen.

[invalid markup]

Learn HTML before you learn J(ava)Script/ECMAScript.

<URL:http://validator.w3.org/>


PointedEars
.



Relevant Pages

  • Re: innerHTML and PHP string parsing
    ... script code as content of a HTML `script' element. ... That is true, but, the implications of what PHP generates to Javascript executing in the UA *is* on-topic here. ... And in order to know what to do in PHP to make it JS friendly then you have to find out what is JS friendly first. ...
    (comp.lang.javascript)
  • Re: script disabiling
    ... You mean you want to disable some JavaScript calls but not others? ... guess you could install a MIME filter and preprocess the script code ... document.documentElement.outerHTML reflects all HTML content on the ... Igor Tandetnik ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Home computer problem
    ... of credibility has been utterly destroyed by your recommendation of ... surfers to a fake antivirus website via malicious JavaScript code injected ... cross-scripting and click-jacking attempts. ... temporary or NO permission, all with a click or two of the mouse. ...
    (alt.home.repair)
  • Re: File format conversion problem...I think
    ... As for permission, ... >> opened the notepad and html and found a blank screen! ... I also have some problem with viewing Word files ...
    (microsoft.public.windowsxp.general)
  • Re: Securing AJAX requests with PHP?
    ... with AJAX, I don't want someone looking at my Javascript and saying, "Hmm, ... but then my permission / auth / workflow schema defines all that. ... When authenticating users, always assign a new id after they ...
    (php.general)