没有AJAX的JSON [英] JSON without AJAX

查看:63
本文介绍了没有AJAX的JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使命宣言:


从任何网站获取文本流到浏览器的机制

,无需重新加载当前页面。


1)这个机制必须支持*至少* IE 5.5及更高版本

和Firefox 1.5及更高版本:但它可能完全不同于一个

浏览器到另一个。重要的是只能在它上面建立一个

统一的界面。


2)这个机制必须利用现代浏览器的一些核心功能

因此,如果不停止浏览器就无法锁定它。

是一个浏览器(如访问链接嗅探)。


Com''on伙计们:让我们破解他们! :-)


我最初的捐款:

1)

< link

id = JSON

title =" JSON&qu​​ot;

rel =" alternate appendix"

type =" text / plain"

href =" data.txt"

charset =" iso-8859-1"

hreflang =" en-US"> ;


甚至不是黑客,但似乎可以获得data.txt内容


2)

< link

id =" JSON&qu​​ot;

title =" JSON&qu​​ot;

rel =" alternate stylesheet"

type =" text / css"

href =" data.css"

charset =" iso-8859-1"

hreflang =" en-US">


这几乎是理想的,因为样式规则声明几乎与JSON对象相同
语法。但是未知属性被忽略

所以:

..data {

key1:value1;

key2:value2 ;

key3:value3;

}

将导致空括号

..data {}


有什么方法可以阻止它吗?


3)

仅限IE浏览器下载行为

没有探索加上似乎太容易升级安全性如果微软

决定。仍然决定提。

P.S.如果你发现一些真正令人惊叹的解决方案符合上面的

要求2)你可能想在公开论坛上发布之前先试着版权。

。或者你可能不会 - 但需要提到



Mission statement:

A mechanics to get text stream into browser from any Web location
without reloading the current page.

1) This mechanics has to support *at the very least* IE 5.5 and higher
and Firefox 1.5 and higher: but it may be completely different from one
browser to another. It is important only to be able to build an
uniformed interface atop of it.

2) This mechanics has to exploit some core features of modern browsers
so it would not be possible to lock it without stopping the browser to
be a browser (like visited links sniffing).

Com''on guys: let''s hack sh** out of them! :-)

My initial donation:
1)
<link
id = "JSON"
title="JSON"
rel="alternate appendix"
type="text/plain"
href="data.txt"
charset="iso-8859-1"
hreflang="en-US">

Not even a hack, but seems to way to get the data.txt content

2)
<link
id = "JSON"
title="JSON"
rel="alternate stylesheet"
type="text/css"
href="data.css"
charset="iso-8859-1"
hreflang="en-US">

That would be nearly ideal as style rule declaration is almost
identical to JSON object syntaxes. But unknown attributes are ignored
so:
..data {
key1:value1;
key2:value2;
key3:value3;
}
will result into empty parenthesis
..data {}

Any way to stop it?

3)
IE-only "download" behavior
Not explored plus seems too easy to "upgrade security" if Microsoft
decides to. Still decided to mention.
P.S. If you find some really breathtaking solution conformant to the
requirement 2) above you may want to try to copyright it first before
posting in a public forum. Or you may don''t - but needs to be
mentioned.

推荐答案

VK写道:
使命陈述:

从任何网站获取文本流到浏览器的机制
而无需重新加载当前页面。

1这个机制必须支持*至少* IE 5.5及更高版本以及Firefox 1.5及更高版本:但它可能完全不同于一个浏览器到另一个浏览器。重要的只是能够在它上面建立一个统一的界面。

2)这个机制必须利用现代浏览器的一些核心功能
所以它不会可以在不停止浏览器的情况下将其锁定为浏览器(如访问过的链接嗅探)。

Com''on伙计们:让我们破解他们! :-)


无需黑客攻击:


< script type =" text / javascript" src =" json.data">< / script>

您甚至可以使用DOM动态加载脚本文件来添加

脚本元素。

[...]

PS如果您发现一些符合上述要求2)的令人惊叹的解决方案,您可能需要先尝试对其进行版权保护,然后才能在公共论坛上发布。


无需'尝试版权''。原创作品的版权是

在某些媒介中被修正的时刻(在大多数司法管辖区内观察

版权)。


或你可能不会 - 但需要提到。
Mission statement:

A mechanics to get text stream into browser from any Web location
without reloading the current page.

1) This mechanics has to support *at the very least* IE 5.5 and higher
and Firefox 1.5 and higher: but it may be completely different from one
browser to another. It is important only to be able to build an
uniformed interface atop of it.

2) This mechanics has to exploit some core features of modern browsers
so it would not be possible to lock it without stopping the browser to
be a browser (like visited links sniffing).

Com''on guys: let''s hack sh** out of them! :-)
No hack required:

<script type="text/javascript" src="json.data"></script>
You can even dynamically load the script files using DOM to add the
script elements.
[...]

P.S. If you find some really breathtaking solution conformant to the
requirement 2) above you may want to try to copyright it first before
posting in a public forum.
No need to ''try to copyright it''. Original work is copyright the
moment it is fixed in some medium (in most jurisdictions that observe
copyright).

Or you may don''t - but needs to be
mentioned.




不,它不会。

- -

Rob



No, it doesn''t.
--
Rob




RobG写道:

RobG wrote:
无需黑客攻击:
< script type =" text / javascript" src =" json.data">< / script>
您甚至可以使用DOM动态加载脚本文件来添加
脚本元素。


这是最明显的一个,已经在这个小组中讨论过了。

缺点:

1)口译员会尝试解析在抵达时收到数据。对于

序列化对象,它会产生不必要的过热加上潜在的

错误流。

是否

scriptObject.defer =真的

有帮助吗?


2)IE支持脚本对象的onreadystatechange。

readyState来自传统IE的字符串表示法:

" uninitialized"

" loading"

" loaded"

" interactive"

完成

(而不是0 -4,这是IE对AJAX用户的部分妥协)。


这很容易修复,但是最新的没有其他竞争对手似乎没有其他竞争对手支持onreadystatechange除了XMLHttpRequest(?)


那么如何获得状态以一种美观可靠的方式更新?

无需'尝试对其进行版权保护'。原创作品的版权是在某些媒介中被修正的时刻(在大多数司法管辖区内都遵守着作权)。
No hack required:
<script type="text/javascript" src="json.data"></script>
You can even dynamically load the script files using DOM to add the
script elements.
That was the most obvious one, already discussed in this group.
Drawbacks:
1) Interpreter will try to parse received data right on arrival. For
serialized objects it will create unnecessary overheat plus potential
error stream.
Does
scriptObject.defer = true
help in that?

2) IE supports onreadystatechange for scriptObject.
readyState comes in traditional IE''s string notation:
"uninitialized"
"loading"
"loaded"
"interactive"
"complete"
(instead of 0 -4, that was IE''s partial compromise for AJAX users).

That would be easy to fix but up to date no other rivals seems to
support onreadystatechange except for XMLHttpRequest (?)

So how to get state update in a nice and reliable way?
No need to ''try to copyright it''. Original work is copyright the
moment it is fixed in some medium (in most jurisdictions that observe
copyright).




阅读已经讨论过的GIF故事。至少在美国,如果您在公共媒体上发布了一些信息,并且没有在此类出版物中声明任何版权,则假定您将其转发给公众

域名。仍然可以反转,但更容易立即说这项工作是我的b
$我想尽快将其版权所有。为什么要让事情变得更加困难? ;-)



Read the already discussed GIF story. At least in the USA if you post
some information in a public media and do not state any copyrights in
such publication, it is assumed that you forward it to the public
domain. Still reversable but easier to say right away "This work is
mine and I want to copyright it as soon as I can". Why make things more
difficult as they should be? ;-)


>更容易立即说这项工作是
> easier to say right away "This work is
我的,我想尽快将其版权所有。
mine and I want to copyright it as soon as I can".




当你可能会注意到*我个人不会在任何地方说出来。

但我无法为其他人采取行动。



As you may notice * I * personally do not say it anywhere.
But I cannot act for everyone else.


这篇关于没有AJAX的JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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