MuYunyun

Results 38 comments of MuYunyun

> Yes, because it doesn’t allow anything other than symbols, strings, and numbers. is there any way to judge including boolean type now? ```ts Expect // it fails ```

@roro4ever 👍 ``` > Math.pow(2, 53)+3 9007199254740994 --> E=53,M=1.000...0011(51个0+2个1,实际存储51个0+1个1) ``` there is small error in `Math.pow(2, 53)+3`, it should be `9007199254740996` :smile:, By the way, I want to confirm the...

> @FrankFan hello > > 版本:GitLab 7.1.1 > 问题:无法显示侧边栏 > 控制台有警告如下: > [Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See...

> https://github.com/tavyandy97/span-tree it works for me.

关于 JSONP 的有一点我想请教下博主您,比如我后台(node.js)拼接了如下代码返回给前台 ```js const obj = { "text": 'jsonp', } const callback = req.url.split('callback=')[1] const json = JSON.stringify(obj) const build = callback + `(${json})` res.end(build) ``` 前端代码: ```js function...

😄 确实纠结在 JSON 数据是如何转换成 JS 代码的这个点上了,我姑且认为浏览器通过 JSONP 格式跨域得到的结果会这样处理吧

@bupthly 我对您这个解释做了个实验,在 response-headers 设置 `Content-Type:text/plain` 或者不设置 `Contenty-Type` ,浏览器照样会将返回内容解析为 js 脚本~

我总结下楼主您的意思是说通过 script 标签引用 jq 脚本将 $ 挂到全局上,然后类比 JSONP 也类似通过 script 标签引用从而将返回的callback(Obj)挂到全局。至于浏览器如何将`callback(Obj)`这个 JSON 对象转成 JS 的我们可以不关心,把它当成一个黑盒。

我在红宝书587页,看到它介绍JSONP的优点有提到一句`它的优点在于能够直接访问响应文本`,里面涉及到的知识点它没有深讲了,愿闻其详 😄

也写了篇[跨域小结](https://github.com/MuYunyun/fe_cloud/issues/13)