Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

█████MingGe1.9.6 更新█████ #229

Open
mingge8888 opened this issue Mar 20, 2016 · 5 comments
Open

█████MingGe1.9.6 更新█████ #229

mingge8888 opened this issue Mar 20, 2016 · 5 comments

Comments

@mingge8888
Copy link

ps 1.96版本

1:$(xxx).index 接口修复

2:$.toJSON 艰难的决择下,有JOSN.stringify通一走JOSN.stringify。没有则走 程序过程,免得再烦了

3:几处API微调,不详

最近工作非常忙。我体会到一个人没钱,你什么都不是,目前对我来说,没什么比吃饭重要!你们体会到了吗?

更新时间:2015年3月20日深夜3:30分

下载:http://www.shearphoto.com/bbs/forum.php?mod=viewthread&tid=41&page=1&extra=#pid89

@mingge8888 mingge8888 changed the title MingGe1.9.6 更新 █████MingGe1.9.6 更新█████ Mar 20, 2016
@mingge8888
Copy link
Author

$.toJSON 问题解答

有人问,为什么有JOSN.stringify你不用,而去走代码过程

其实是有原因,我们首先看一下例子

JOSN.stringify({a: document})

WEBKIT浏览器下是直接报错的

而火孤 浏览器下 JOSN.stringify({a: document})有输出的

JOSN.stringify在每个浏览器的差异何止上述这些,
我当时就想,不如全部浏览器统一走代码过程,让输出结果统一起来

但是我走代码过程后,我又发现某些人拿 JOSN.stringify的输出结果与 走代码过程的结果进行对比
例如这句$.toJSON({a:new date()}),我走过程时,是没有输出的。而JOSN.stringify是有结果的

我在想,如果继续再写判断,也是治标不治本, 只会无休止的一直判断,
JOSN.stringify是属于原生API,其实他也有漏洞,他在每种浏览器下都有极大的差异,
所以我认为没有必要再和 JOSN.stringify 结果完全一致,我已经没办法再判断下去了

我思考了几分钟,我作了艰难的选择,
$.toJSON默认: 当浏览器有 JOSN.stringify时,用JOSN.stringify执行
当 浏览没有 JOSN.stringify(如IE 678)走过代码过程。

但是这样做,可能会造成甘些情况下,各浏览器有差异
所以 $.toJSON 在后面再新增一个参数,: 是否走代码过程

$.toJSON(OBJECT, true 或 false) @参数1 :OBJECT对象, @参数2:是否走代码过程

@jessed2016
Copy link

明哥好

@wenzi0github
Copy link

做了一个艰难的决定:minggejs和jQuery只能选择一个

@mingge8888
Copy link
Author

@wenzi0github JQ和minggejs 是可以共存的,一开始先双类库,慢慢适应,再删掉JQ

把minggejs打开,拉到尾部,把“$“ 替换成其他就变量名称

@zunsthy
Copy link

zunsthy commented Feb 12, 2017

火孤 浏览器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants