将网页加载到变量 [英] load web page to variable

查看:86
本文介绍了将网页加载到变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页的网址。

我想将网页的内容加载到一个变量。


这样:


变量= loadwebpage(url)


怎么做?


(我刚刚花了一个多小时谷歌搜索食谱 - 没有

满意度)


-tt。

I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?

(I have just spent more than an hour googling for a recipe - without
satisfaction)

-tt.

推荐答案

Tomek Toczyski写道:
Tomek Toczyski wrote:

我有一个网页的网址。

我想加载内容将网页改为变量。


这样:


variable = loadwebpage(url)


如何做?
I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?



如果请求URI的协议,域和端口部分与

相同,则可以使用(I)XMLHttpRequest对象。否则你必须使用

服务器端解决方案,至少部分。您可以使用URL重写来处理相同的原始策略,或者您可以使用

服务器端脚本来检索资源。


请注意,可能涉及版权/作者的权利。


这是常见问题。

HTH


PointedEars

-

"使用任何版本的Microsoft Frontpage创建您的网站。 (这不会是b $ b阻止人们查看你的来源,但是没有人会想要窃取它。)"

- 来自< http:// www.vortex-webdesign.com/help/hidesource.htm>

Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object. Otherwise you have to use
a server-side solution, at least partially. You can work around the Same
Origin Policy with URL rewrite, or you can retrieve the resource with
server-side scripting.

Note that copyright/author''s rights may be involved.

This was a FAQ.
HTH

PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won''t
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>


Thomas''PointedEars''Lahn:
Thomas ''PointedEars'' Lahn:

Tomek Toczyski写道:
Tomek Toczyski wrote:

>我有一个网页的网址。
我想将网页的内容加载到变量。

这样的:

变量= loadwebpage(url)

怎么做?
>I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?



如果请求URI的协议,域和端口部分与

相同,则可以使用(I)XMLHttpRequest对象。


Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object.



是的,一切都是一样的。


感谢您的提示。但是我需要一个有效的工作方法。

我不是AJAX程序员而且我只掌握Javascript的基本知识

,我现在没有时间学习它。 br />

我需要一个用于将网页加载到变量的配方...

一件简单的事情。我很乐意为你提供帮助。


-tt

Yes, everything is the same.

Thank you for your hint. But I need a working recipe.
I am not an AJAX programmer and I have only basic knowledge of Javascript
and I have no time to learn it at the moment.

I need a recipe for loading a webpage to a variable...
One simple thing. I will be glad for your help.

-tt


Tomek Toczyski写道:
Tomek Toczyski wrote:

Thomas''PointedEars''Lahn:
Thomas ''PointedEars'' Lahn:

> Tomek Toczyski写道:
>Tomek Toczyski wrote:

>>我有一个网页的网址。
我想将网页的内容加载到一个变量。

这样:

variable = loadwebpage(url)

怎么做?
>>I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?


如果请求URI的协议,域和端口部分相同,则可以使用(I)XMLHttpRequest对象。

Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object.



是的,一切都是一样的。


感谢您的提示。但是我需要一个有效的工作方法。

我不是AJAX程序员而且我只掌握Javascript的基本知识

,我现在没有时间学习它。 br />
我需要一个用于将网页加载到变量的配方...


Yes, everything is the same.

Thank you for your hint. But I need a working recipe.
I am not an AJAX programmer and I have only basic knowledge of Javascript
and I have no time to learn it at the moment.
I need a recipe for loading a webpage to a variable...



您正在寻找付费支持论坛,而不是此讨论组。

You are looking for a paid support forum, not this discussion group.


一件简单的事情。我很乐意为你提供帮助。
One simple thing. I will be glad for your help.



究竟多少钱?

PointedEars

-

Prototype.js是由不懂javascript的人写的

谁不懂javascript。不知道javascript的人不是设计使用javascript的系统的最佳建议来源。

- Richard Cornford,cljs,< f8 ** *****************@news.demon.co.uk>

How much exactly?
PointedEars
--
Prototype.js was written by people who don''t know javascript for people
who don''t know javascript. People who don''t know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>


这篇关于将网页加载到变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆