如何将URL检索到变量中? [英] How do I retrieve a URL into a variable?
问题描述
我想知道是否有JS函数将URL检索到变量中
cURL = somefunction(" http:// www.domain.com");
有这样的东西吗?
TIA,
Tom
I like to know if there is a JS function to retrieve a URL into a variable
cURL = somefunction("http://www.domain.com");
Is there something like this?
TIA,
Tom
推荐答案
" Tom Szabo" < to*@intersoft.net.au>在留言中写道
新闻:41 ******** @ dnews.tpgi.com.au ...
"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41********@dnews.tpgi.com.au...
我想知道是否有一个JS函数可以将URL检索到变量中
cURL = somefunction(" http://www.domain.com");
是否有类似的东西这个?
TIA,
Tom
I like to know if there is a JS function to retrieve a URL into a variable
cURL = somefunction("http://www.domain.com");
Is there something like this?
TIA,
Tom
通过检索网址你的意思是包含JS的页面吗?
< html>
< head>
< title> loc~href.htm< / title>
< script type =" text / javascript">
var url = document.location.href;
document.write(url);
< / script>
< / head>
< body>
< / body>
< / html>
By "retrieve a URL" do you mean of the page containing the JS?
<html>
<head>
<title>loc~href.htm</title>
<script type="text/javascript">
var url = document.location.href;
document.write(url);
</script>
</head>
<body>
</body>
</html>
2004年11月17日星期三12:31 :43 GMT,McKirahan写道:
On Wed, 17 Nov 2004 12:31:43 GMT, McKirahan wrote:
" Tom Szabo" < to*@intersoft.net.au>在消息中写道
新闻:41 ******** @ dnews.tpgi.com.au ...
"Tom Szabo" <to*@intersoft.net.au> wrote in message
news:41********@dnews.tpgi.com.au...
我想知道是否有JS将URL检索到变量的函数
cURL = somefunction(" http://www.domain.com");
I like to know if there is a JS function to retrieve a URL into a variable
cURL = somefunction("http://www.domain.com");
....按检索一个URL你的意思是包含JS的页面吗?
.... By "retrieve a URL" do you mean of the page containing the JS?
我怀疑OP实际上指的是检索另一个URL的内容
(比页面本身)将JS var作为文本。
-
Andrew Thompson
http://www.PhySci.org/codes/ Web& IT帮助
http://www.PhySci.org/ 开源软件套件
http://www.1point1C.org/ Science&技术
http://www.LensEscapes.com/ 图像逃脱世俗的
I suspect the OP is actually referring to retrieving the content
of another URL (than the page itself) into a JS var as text.
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
>通过检索URL你的意思是包含JS的页面吗?
我可能会使用错误的术语,我的目的是获取网页内容
指向....的URL
var" url"将包含类似的内容:
"< html>
< head>
.....
......
/ html>"
我有意义吗?对不起,如果还没有....
TIA,
Tom
> By "retrieve a URL" do you mean of the page containing the JS?
I could be using the wrong terminology, what I ment is to get the content of
the web page the URL pointing to....so
var "url" would contain something like:
"<html>
<head>
.....
......
/html>"
Am I making sense? sorry if still not ....
TIA,
Tom
>
这篇关于如何将URL检索到变量中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!