2017-02-18 148 views

回答

0

要解決這一點,你需要將index.html(或任何您命名包含深水客戶端連接的文件)提供給Web服務器。

當您連接到Web服務器訪問的index.html然後它會執行JavaScript啓動deepstream客戶端然後將建立在IE瀏覽器運行deepstream服務器的連接:默認端口6020

希望這幫助。

0
Hi Im also a new user. Have you installed all the needed packages? 
For me it works and my Index.html looks like this: 

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/deepstream.io-client-js/2.1.1/deepstream.js"></script> 
    </head> 
    <body> 
    <div id="app"></div> 
    <input type="text" /> 
    <script type="text/javascript"> 
     var client = deepstream('localhost:6020').login(); 
     var record = client.record.getRecord('myname'); 
     var input = document.querySelector('input'); 


      console.log("helloooo"); 
      record.set('firstname', input.value); 
     }); 

     record.subscribe('firstname', function(value) { 
      input.value = value; 
     }); 

    </script> 
    </body> 
</html>