在0.9.16中,我使用socket.emit和回调,以便聊天服务器返回一些数据,我可以根据确认处理结果.但升级到1.3.5之后,我在控制台中发现了这样的错误
未捕获的TypeError:无法读取未定义的属性"apply".
我做过这样的事,
来自网络
socket.emit('userToUser', { 'usename': 'John',
'message': 'hi'
}, function(callback){
//callback handled
});
Run Code Online (Sandbox Code Playgroud)
聊天服务器
socket.on('userToUser', function(content, callback){
//do something
if(callback) return callback({'result':'success', 'messageid':content.messageid, 'chatid':content.chatid});
});
Run Code Online (Sandbox Code Playgroud)
当我从客户端删除回调时,没有错误.所以我相信在回调中会有一些变化.
我收到了确认,聊天工作正常,但我担心的是控制台错误导致socketio.js
Socket.prototype.onack = function(packet){
debug('calling ack %s with %j', packet.id, packet.data);
var fn = this.acks[packet.id];
fn.apply(this, packet.data);
delete this.acks[packet.id];
};
Run Code Online (Sandbox Code Playgroud)
伙计们,请帮忙
我需要在一个数据表中添加一个新行,该数据表应放在表的顶部,我使用了排序插件,但它失败了.
有人可以帮我解决这个问题吗?
我在我的PHP项目中尝试分页,codeigniter有自己的类叫做"分页",我已经使用过了.现在我的视图页面中有一个页面链接.但是所有数据都打印在一个页面中,这是我的代码..
$mydata = array('mydata' => $this->Admin_model->view_job_posts());
$this->load->library('pagination');;
$config['base_url'] =site_url('/admin/view_job_posts/');
$config['total_rows'] = count($mydata["mydata"]);
$config['per_page'] = 1;
$config['num_links'] = 2;
$config['uri_segment'] = 2;
$this->pagination->initialize($config);
$mydata['links'] = $this->pagination->create_links();
$this->load->view('pages/admin_view_jobs', $mydata);
Run Code Online (Sandbox Code Playgroud)
帮帮我们!
我正在开发' Paper Toss'for iphone using cocos2d&我想知道如何实现3D透视图,因为当我们将纸球扔到垃圾箱时,我们必须得到3D感觉.我附上了我的代码完成,使用这个我有一个直线运动.请帮助我..
*- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
// Choose one of the touches to work with
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:[touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
// Set up initial location of projectile
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCSprite *projectile = [CCSprite spriteWithFile:@"ball.png"
rect:CGRectMake(0, 0, 40, 40)];
projectile.position = ccp(winSize.width/2,20);
// Determine offset of location to projectile
int offX = location.x - …Run Code Online (Sandbox Code Playgroud) 我在IE9中遇到了一个问题,比如"SVG4601:SVG路径数据格式不正确,无法完全解析",同时使用Raphael JS和SVG在HTML5页面中绘制饼图.当我绘制svg路径时,由于"d"属性,d ="(路径数据)"为空,饼图不会出现并显示控制台错误,如"SVG4601:SVG路径数据格式不正确,不能完全解析".
HTML内容应该是这样的......
<path style="fill: #993333; stroke: #ffffff; stroke-width: 0;" fill="#993333" stroke="#ffffff" stroke-width="0" d="M261.5,86.4 A100,100,0,1,0,271.5,98.5"/>
Run Code Online (Sandbox Code Playgroud)
但我进入IE9 ..
<path style="fill: #993333; stroke: #ffffff; stroke-width: 0;" fill="#993333" stroke="#ffffff" stroke-width="0" d=""/>
Run Code Online (Sandbox Code Playgroud)
目前它完全适用于IE8和所有其他浏览器.任何帮助将不胜感激.
在我的php项目中我使用了jpegcam,http://code.google.com/p/jpegcam/& 当我们加载网络摄像头捕获页面时,它要求Flash播放器权限"允许或拒绝",即使我拒绝了选项捕获按钮已启用.我想在加载时禁用捕获按钮并仅在用户允许权限时启用!
那么如何检查用户是否允许或拒绝在网站的隐私设置对话框中访问网络摄像头?!伙计们,任何帮助将不胜感激.. :)
javascript ×2
node.js ×2
codeigniter ×1
datatables ×1
flash ×1
html5 ×1
iphone ×1
jquery ×1
pagination ×1
php ×1
pie-chart ×1
raphael ×1
socket.io ×1
svg ×1
upgrade ×1
webcam ×1