您的位置:

js远程程序,程序员远程

本文目录一览:

JAVASCRIPT如何获取远程页面内容

JS AJAX技术获取网页源代码是不行的...

要用其他方法...

例如,我用PHP的套接字模拟HTTP协议的方式编写一个获取源代码的PHP程序.

再用JS AJAX调用这个PHP程序.. 就能实现跨域了..

当然,你如果会JAVA,直接写个JAVA Applet也行...利用 URLConnection类,获取源代码轻而易举...

如何实现 JS 远程控制服务器开关机?

首先,你的服务器JS是控制不了的,必须用C,C++之类的后台语言控制,至于JS就是发个信号给你的服务器,让你的服务器后台语言控制这个服务器的开和关

js 远程调用 怎么实现

RMI:  Remote Method Invoke 远程方法调用

用js调用java,java实现远程调用。

jsonRPC 机制调用

ajax 调用

JavaScript怎么连接远程服务器,只要能建立通信就行。不需要任何功能?

你说的连接是指什么?访问也是连接啊,你用js从远程服务器下载一个文件,这也算连接啊。

如果你是指登录远程服务器的话,这个需要远程服务器首先提供了登录接口,否则是登录不了的

远程调用js

JsLoader,动态加载远程js代码

/**

* Construct a new JSLoaderEnvironment instance

* @class JSLoaderEnvironment is the class designed to be a

* representation of a unix-like shell environment.

* The purpose of this is to allow the infrastructure to abstract

* away any library file location knowledge for rapid and enterprise

* adoption and deployment

*/

function JSLoaderEnvironment(){

// Default

this.prefix="/assets/";

// Auto-discover location

var _remote=false;

var s=0;

var _script_tags=document.getElementsByTagName("script");

var endsWith=function(str, substr){

return (str str.indexOf(substr) == (str.length-substr.length));

};

for(s=0;s_script_tags.length;++s){

var src=_script_tags[s].src;

var src_orig=src;

if(src){

if(src.indexOf("://")-1)

{

src=src.substring(src.indexOf("://")+3);

src=src.substring(src.indexOf("/"));

}

if(endsWith(src,"jsloader.js") || endsWith(src,"jsloader-debug.js")) {

// If the domain is remote, assume we're running in hosted mode

_remote=(src_orig.indexOf(document.domain)==-1);

if(_remote) src=src_orig;

this.prefix=src.substring(0, src.lastIndexOf("/")+1);

}

}

}

/**

* @private

*/

this.suffix=".js";

/**

* @private

* Make the Path of a module to meta/proj/release

*/

this.makeJSLoaderPath=function(m,p,r,suff){

// if just a url is specified, use it

if(!p !r) return this.stripExternalRef(m);

// build the m/p/r path

return this.prefix+m+"/"+p+"/incr/versions/"+r+ ((suff)?this.suffix:"");

}

/**

* The generate the path prefix for a MPR linked into the JSLoader Environmentiables

* @param m meta

* @param p project

* @param r release

*/

this.makePath=function(m,p,r){

// if just a url is specified, use it

if(!p !r) return this.stripExternalRef(m);

// build the m/p/r path

return this.prefix + m +"/" + p + "/" + r + "/";

}

/**

* @private

*/

this.env=new Object();

/**

* @private

*/

this.loaders=new Object();

/**

* The sets an environment variable (make sure it's safe for JS Object[key] notation)

* The idea here is that modules could set this, and pages which load the module

* can then get the Environment variables

* @param k javascript object[key]

* @param v value (technically could be of any type...)

*/

this.setEnv=function(k,v){

this.env[k]=v;

}

/**

* The gets an environment variable previously set

* @param k javascript object[key]

* @returns the value set for this key

*/

this.getEnv=function(k){ return this.env[k];}

/**

* Lists all modules

* loaded in this environment.

* @private

*/

this._loadedJSLoaders=new Object();

/**

* This makes a normalized key to stick into loaded_modules and verify if things are loaded.

* @private

*/

this.normalize=function(m,p,r){ return (m+"__"+p+"__"+r).toLowerCase();};

/**

* This checks whether the given meta/project/release is already loaded.

* @param m metaproject (or the path of a JS file, if no other args are passed)

* @param p project

* @param r release

* @type boolean

* @returns Whether m/p/r is loaded

*/

this.isLoaded=function(m,p,r){

var xkey=this.normalize(m,p,r);

return(this._loadedJSLoaders[xkey]!=null);

};

/**

* Gets a "loader" based on the MPR specified in the arguments

* This is useful for loading subpackages. You can call {@link JSSubLoader#load} or {@link JSSubLoader#loadAll} on this

* and it will load submodules under a folder with the "release" number

* @see JSSubLoader

* @param m metaproject

* @param p project

* @param r release

* @returns void

*/

this.getLoader=function(m,p,r){

var key=this.normalize(m,p,r);

var loader=this.loaders[key];

if(loader) {

return loader;

}

else {

loader=new JSSubLoader(this,this.makeJSLoaderPath(m,p,r,false)+"/");

var __path=this.makePath(m,p,r);

this.setEnv(p.toUpperCase()+"_PATH",__path);

this.loaders[key]=loader;

return loader;

}

}

/**

* Loads the requested module into the environment

* You can also load your own module by calling loadJavascript(url) if you want

* @param m metaproject

* @param p project

* @param r release

* @type boolean

* @returns void

*/

this.load=function(m,p,r){

var key=this.normalize(m,p,r);

var url=this.makeJSLoaderPath(m,p,r,true);

try{

if(this.isLoaded(m,p,r)) {

return;

}

this.loadJavaScript(url);

this._loadedJSLoaders[key]="true";

} catch (e){ this.handleError(e); }

};

/**

* Loads a JavaScript file into the page

* @param {String} url the url of the javascript file

*/

this.loadJavaScript=function (url){

url = this.stripExternalRef(url);

document.writeln("scri"+"pt src='"+url+"' type='text/javascript'/sc"+"ript");

};

/**

* Loads a JavaScript file into the page

* @param {String} url the url of the javascript file

*/

this.loadStyleSheet=function(url){

url = this.stripExternalRef(url);

document.writeln("li"+"nk rel='stylesheet' href='"+url+"' type='text/css'/li"+"nk");

};

/**

* Strips out any double slashes, double dots, or cross domain references.

* @param s string

*/

this.stripExternalRef=function(s){

var exprs = [/\.\.+/g,/\/\/+/g,/\\\\+/g,/\:+/g,/\'+/g,/\%+/g];

// If it's hosted, we relax the protocol related regex

exprs = [/\.\.+/g,/\\\\+/g,/\'+/g,/\%+/g];

if (_remote)

for(var i=0; iexprs.length; i++)

{

s = s.replace(exprs[i], '');

}

return s;

}

/**

* Overwritable error handler

*/

this.handleError=function(e) {

}

return this;

};

/**

* Construct a new JSSubLoader instance. You shoudl never need to call this, as {@link JSLoaderEnvironment#getLoader} gets you one of these from the environment.

* @class JSSubLoader is designed to load "sub" modules

* This is a wrapper which is produced when you call {@link JSLoaderEnvironment#getLoader}

* It is designed to allow sub-packages within a given MPR to be loaded easily. This is constructed by JSLoader.getLoader() call

* so you should never really need to construct one of these.

* @constructor

* @param {JSLoaderEnvironment} env_

* @param {String} prefix_ The path underneath which the submodules reside

*

*/

function JSSubLoader(env_, prefix_){

/**

* @private

*/

this.environment=env_;

/**

* @private

*/

this.prefix=prefix_;

/**

* @private

*/

this.loaded=new Object();

/**

* @private

*/

this.normalize=function(str){ return str.toLowerCase(); }

/**

* Loads an array of subpackages

* @param {Array} pkgs an array of packages.

*/

this.loadAll=function(pkgs_){

for(i=0;ipkgs_.length;++i) this.load(pkgs_[i]);

};

/**

* Loads a subpackage, if it's not already loaded

* @param {String} url the url of the sub-package module file (m/p/r/submodule.js)

*/

this.load=function(pkg){

var p=this.normalize(pkg);

if (this.loaded[p]) {

return;

}

this.loaded[p]=pkg;

this.environment.loadJavaScript(prefix_+pkg+".js");

};

};

JSLoader = new JSLoaderEnvironment();

// LocalWords: fileoverview

js远程程序,程序员远程

2022-11-24
js高级程序设计笔记14(js高级程序设计笔记14页)

本文目录一览: 1、JavaScript高级程序设计 该怎么看 2、JavaScript学习笔记之数组基本操作示例 3、JS中有关sort以及return的问题 JavaScript高级程序设计 该怎

2023-12-08
jsp程序开发学习笔记2,jsp程序设计题库

本文目录一览: 1、《JSP&Servlet学习笔记》pdf下载在线阅读,求百度网盘云资源 2、林信良编著jsp&servlet学习笔记第2版课后答案吗 3、jsp有没有快速掌握的办法呀? 4、要学J

2023-12-08
如果用js远程读取网页内容(如果用js远程读取网页内容怎么办

本文目录一览: 1、js如何在本地远程读取指定url的内容? 2、js读取远程网页源码 3、JAVASCRIPT如何获取远程页面内容 js如何在本地远程读取指定url的内容? 你的意思是,你的电脑上有

2023-12-08
java远程,java远程debug

2023-01-09
java远程调用,java远程调用技术

2022-11-30
htmljs编程笔记(html代码笔记)

本文目录一览: 1、html代码和JS代码有什么区别 2、如何在html中调用js函数 3、JavaScript学习笔记之数组基本操作示例 4、HTML5初学者笔记 5、《web前端笔记7》js字符—

2023-12-08
java程序员培训,java编程培训

2022-11-17
程序员记事本:程序员必备的神器

2023-05-19
Java远程调试:如何在开发中调试远程应用程序

2023-05-18
java远程调用,java远程调用接口几种方式

2023-01-03
java程序员开发指南(java程序设计笔记)

2022-11-15
java程序员,java程序员证书

2022-12-01
java笔记,尚硅谷java笔记

2022-12-01
js前端程序员,程序员做前端

2022-11-24
java实现远程接口访问(java远程接口访问文档)

2022-11-14
远程调试jsp,远程调试过程失败

2022-11-24
java程序员工资,Java程序员工资七千

2023-01-06
php程序员知识大全,php程序员知识大全

2022-11-27
大神程序员js,大神程序员和初级程序员

本文目录一览: 1、北大青鸟设计培训:Node.js程序员必须熟练掌握的十项JS概念? 2、JavaScript程序员的工资能有多少? 3、求教大神,js中刷新页面触发事件的代码应该怎么写? 4、求大

2023-12-08