Closed dushyantRathore closed 5 years ago
I have the folder directory similar to the image shown below :
I have installed the node module using npm.
Now, when I try to run the following code block by importing the module in html code the file test.html, I don't see anything in the console output.
<html> <head> </head> <body> <script type="text/html"> import { CometChat } from "./node_modules/@cometchat-pro/chat"; var appID = "MY_APP_ID"; CometChat.init(appID).then( hasInitialized => { console.log("Initialization completed successfully", hasInitialized); // You can now call login function. }, error => { console.log("Initialization failed with error:", error); // Check the reason for error and take apppropriate action. } ); </script> </body> </html>
If possible, can you redirect me to a working javascript code for the same..since it lacks in the documentation/Github repo as well
Hello @dushyantRathore If you wish to use it with javascript browser environment, you can include the script in following way
Got it working..thanks.
I have the folder directory similar to the image shown below :
I have installed the node module using npm.
Now, when I try to run the following code block by importing the module in html code the file test.html, I don't see anything in the console output.
If possible, can you redirect me to a working javascript code for the same..since it lacks in the documentation/Github repo as well