我注意到我的JS应用程序有时变慢(所有UI都变慢).我试图找出原因,我注意到PUBNUB取消订阅事件真的很重.所有其他PUBNUB事件,例如州,订阅都很好.
它应该是异步的,我知道,但即使是异步也会减慢整个应用程序的速度,即使它非常简单.
我使用pubnub存在.

你知道那是怎么回事吗?这是一个pubnub bug吗?以及如何提高它的性能.
我使用了Reflux,通常我在进行ajax调用后触发,并且运行良好.出于测试目的,我不需要ajax调用,并且我注意到除非我给出最小5ms的超时,否则触发器将不起作用.这是工作而不是工作的例子.
不工作的例子:
window.threadStore = Reflux.createStore
init: ->
@state = @getInitialState()
@fetchThreads()
getInitialState: ->
loaded: false
threads: []
fetchThreads: ->
# ajax call for not Testing, and just trigger for Testing
@state.threads = FakeData.threads(20)
@state.loaded = true
@trigger(@state) # This will NOT work!
Run Code Online (Sandbox Code Playgroud)
window.threadStore = Reflux.createStore
init: ->
@state = @getInitialState()
@fetchThreads()
getInitialState: ->
loaded: false
threads: []
fetchThreads: ->
# ajax call for not Testing, and just trigger for Testing
@state.threads = FakeData.threads(20)
@state.loaded = true
setTimeout( =>
@trigger(@state) # …Run Code Online (Sandbox Code Playgroud) 当通过 sendgrid 从 Rails 发送电子邮件时,有什么方法可以禁用某些链接的链接跟踪吗?
一个页面应用程序,其中有用户配置文件页面(您动态更改).
这不起作用,它显示为链接
<a href='https://twitter.com/{{user.twitter}}' class='twitter-follow-button' data-show-count='false' data-size='large'>Follow @{{user.twitter}}</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
Run Code Online (Sandbox Code Playgroud)

如果它重新初始化代码,它也不起作用
<div ng-show="user.twitter" ng-bind-html-unsafe="user.twitter|followButton">
Run Code Online (Sandbox Code Playgroud) a = "{key:'14',data:{order: '154'}}"
JSON.parse(a)
Run Code Online (Sandbox Code Playgroud)
预期行为:
{key:'14',data:{order: '154'}}
Run Code Online (Sandbox Code Playgroud)
结果:
SyntaxError: unexpected tIDENTIFIER, expecting end-of-input
Run Code Online (Sandbox Code Playgroud)