站长资源网络编程

nodejs实现获取当前url地址及url各种参数值

整理:jimmy2026/8/4浏览2
简介复制代码 代码如下://需要使用的模块 http url当前url http://localhost:8888/selectaa=001&bb=002var http = require('http');var URL = require('url');http.createSer

复制代码 代码如下:
//需要使用的模块 http   url
当前url   http://localhost:8888/select"codetitle">复制代码 代码如下:
var testUrl =  'http://localhost:8888/select"codetitle">复制代码 代码如下:
http://mj_0203.0fees.net/index.php?aa=001&bb=002
document.location:        http://mj_0203.0fees.net/index.php?aa=001&bb=002
document.URL:             http://mj_0203.0fees.net/index.php?aa=001&bb=002
document.location.href:   http://mj_0203.0fees.net/index.php?aa=001&bb=002
self.location.href:       http://mj_0203.0fees.net/index.php?aa=001&bb=002
top.location.href:        http://mj_0203.0fees.net/index.php?aa=001&bb=002
parent.document.location: http://mj_0203.0fees.net/index.php?aa=001&bb=002
top.location.hostname:    mj_0203.0fees.net
location.hostname:        mj_0203.0fees.net