- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I'm trying to build a client server application. I will use Node.js and socket.io. UI part is not important.
I only want to know; how can i solve "not defined" error.
I have two files; index.html and app.js.
index.html contains "<script type="application/javascript" src="/socket.io/socket.io.js"></script>"
app.js contains "var socket = io.connect();" command. But Editor gives me JSHint Problems: "io is not defined. (W117)"
I'm always getting this "not defined" error when i write require('blabla.js'), JQuery.
There is no any article or video about integrating a socket.io and node.js in Intel XDK. I really like to use Intel XDK. I hope i can find a solution to use ide.
What am i missing, can you help pls?
(Sorry for bad english)
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are special comment lines, see below, where you can 'define' your JSLint vars e.g:
/*jslint browser:true, devel:true, white:true, vars:true */
/*global $:false, intel:false app:false, dev:false, cordova:false */
add io:true to the jslint comment line and your "not defined" error is solved.
/*jslint browser:true, devel:true, io:true, white:true, vars:true */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll need to look over the JSHint and JSLint docs to get info on how the special comment lines work.
Note that you are not able to debug that nodeJS code with the XDK -- it will only help you debug client-side HTML5 code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ahmet,
could you share your code with me? I have been trying to get this running but don't get it to work. I always get http://<myserver>/socket.io/1/?t=1439847508698 error. I have the same setup nodejs and socket.io.
Thank you very much.
Regards, Nils

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page