Skip to content

Not working with XHTML documents #460

@lacco

Description

@lacco

Socket.io client library does not work when using it with XHTML documents with cross domain access

How can I reproduce the problem?

  1. Start socket.io server on http://localhost:8888
  2. Save https://gist.github.com/15fc854708f97cb9323e in test.html and test.xhtml
  3. Open test.html and test.xhtml at http://localhost:4444/test.(html|xhtml)

What am I expected to see?
Both documents should alert "Connected", but only the .html variant works. Tested browsers: FF5, Safari 5.1, Chrome

What might cause the issue?
In a cross-domain environment, a "SCRIPT" tag instead of a "script" tag is inserted. XHTML is based on XML and is case insenstive. XHTML tags should be in lower case (http://www.w3.org/TR/xhtml1/#h-4.2). The following fix in /socket.io/
socket.io.js, line 1539, should solve the issue:

-         , script = document.createElement('script');

Activity

rauchg

rauchg commented on Sep 3, 2011

@rauchg
Contributor

Fixed in socket.io-client:
socketio/socket.io-client@24c3017

added 3 commits that reference this issue on Jul 4, 2024
24c3017
2e25662
10e3802
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rauchg@lacco

        Issue actions

          Not working with XHTML documents · Issue #460 · socketio/socket.io