如何在javascript中设置标志 [英] How to set flag in javascript

查看:84
本文介绍了如何在javascript中设置标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 Var isConnected =  false ; 





 $。connection.hub.start()。done( function ()
{

console .log(' 现已连接,连接ID =' + $ .connection.hub.id);.

});


function StartStream(mac,ip,port){

linkConditioningHubstart.server.startstreaming( mac,ip,port)

}







当我的时候页面加载集线器连接也加载。我设置一个标志



var isConnected = false;



现在如何使用标志检查连接是真还是假。

如果isConnected为真意味着我调用函数startstream方法。



其中使用那个标志以及如何设置真或假。



请帮助我....

解决方案

< blockquote> .connection.hub.start()。done( function ()
{

console .log(' 现已连接,连接ID =' +


.connection.hub.id);。

});


function StartStream(mac,ip,port){

linkConditioningHubstart.server.startstreaming( mac,ip,port)

}







当我的时候页面加载集线器连接也加载。我设置一个标志



var isConnected = false;



现在如何使用标志检查连接是真还是假。

如果isConnected为真意味着我调用函数startstream方法。



其中使用那个标志以及如何设置真或假。



请帮助我....


 

Var isConnected = false;



$.connection.hub.start().done(function () 
{

console.log('Now connected, connection ID=' + $.connection.hub.id);.

});


function StartStream(mac,ip,port) {

linkConditioningHubstart.server.startstreaming(mac, ip, port)
       
}


Hi,

When my page load the hub connection is also loaded.I set one flag

var isConnected = false;

Now how to check connection is true or false using the flag.
if isConnected is true means i call the function startstream method.

Where to use that flag and how to set true or false.

Please Help Me....

解决方案

.connection.hub.start().done(function () { console.log('Now connected, connection ID=' +


.connection.hub.id);. }); function StartStream(mac,ip,port) { linkConditioningHubstart.server.startstreaming(mac, ip, port) }


Hi,

When my page load the hub connection is also loaded.I set one flag

var isConnected = false;

Now how to check connection is true or false using the flag.
if isConnected is true means i call the function startstream method.

Where to use that flag and how to set true or false.

Please Help Me....



这篇关于如何在javascript中设置标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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