Try this for the html, loads socket.io from a CDN. (Works on my computer...)

<script src="//
cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js"></script>
<script>
  var socket = io.connect('http://localhost');
  socket.on('news', function (data) {
    console.log(data);
    socket.emit('my other event', { my: 'data' });
  });
</script>


On Thu, Nov 1, 2012 at 3:01 PM, _Kili_ <[email protected]> wrote:

> Thanks, I posted the same question to the correct group. I did not yet
> solve the problem with the help in the previous answers. Thanks for the
> quick replies.
>
> torstai, 1. marraskuuta 2012 23.29.38 UTC+2 Chad Engler kirjoitti:
>>
>> You may get more response form the Socket.io mailing list:
>>
>>
>>
>> [email protected]
>>
>>
>>
>> -Chad
>>
>>
>>
>> *From:* [email protected] [mailto:nod...@googlegroups.**com] *On
>> Behalf Of *Angel Java Lopez
>>
>> *Sent:* Thursday, November 01, 2012 5:28 PM
>> *To:* [email protected]
>>
>> *Subject:* Re: [nodejs] Problem with using socket.io
>>
>>
>>
>> Hmmm... you must open the index.html as
>>
>> http://localhost/index.html
>>
>> I guess you cannot start it as a local file
>>
>> On Thu, Nov 1, 2012 at 6:12 PM, _Kili_ <[email protected]> wrote:
>>
>> Hi,
>>
>> I am beginner with node.js and just trying to make socket.io work with
>> this guide http://socket.io/#how-**to-use <http://socket.io/#how-to-use> (the
>> first example).
>>
>> I am just getting "Uncaught ReferenceError: io is not defined" in the
>> java script console of the Chrome.
>>
>> Could someone help me?
>>
>>
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-**
>> Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines>
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>>
>> To unsubscribe from this group, send email to
>> nodejs+un...@**googlegroups.com
>>
>> For more options, visit this group at
>> http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en>
>>
>>
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-**
>> Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines>
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>>
>> To unsubscribe from this group, send email to
>> nodejs+un...@**googlegroups.com
>>
>> For more options, visit this group at
>> http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en>
>>
>>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>



-- 
John R. Fitzgerald

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to