Opened 11 years ago
Closed 11 years ago
#12126 closed bug (invalid)
jquery html from xml
Reported by: | puchuu | Owned by: | puchuu |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
http://stackoverflow.com/questions/11609028/jquery-html-from-xml
For dmethvin: do not close issue if you dont understand it. you can contact with me for any extra information
Change History (8)
comment:2 Changed 11 years ago by
Owner: | set to puchuu |
---|---|
Status: | new → pending |
You're right, I have no idea what you are trying to do. You're trying to append XML nodes to an HTML document? Can you provide a clear example in plain JavaScript?
comment:3 Changed 11 years ago by
Status: | pending → new |
---|
ok. I will paste link to jsfiddle here in 5-10 minutes
comment:5 Changed 11 years ago by
for dmethvin: I've newer used bugtracker to ask questions. I've posted a workaround on stackoverflow and than created an issue to share my experience with jquery developers
comment:6 follow-up: 7 Changed 11 years ago by
$(data).find("section").html()
You're trying to call .html()
on XML nodes. Is that correct? The documentation for .html()
is pretty clear it isn't available on XML documents. http://api.jquery.com/html/
I've newer used bugtracker to ask questions.
That is not what a bug tracker is for, so you were correct in using StackOverflow.
comment:7 Changed 11 years ago by
Replying to dmethvin:
You're trying to call
.html()
on XML nodes
I want: get html from xml without using CDATA + .text(). This is possible in theory because this xml is valid html. This is possible with jquery only with workaround that I've posted
comment:8 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The text markup string may be valid HTML5, but the in-memory data structures are XML nodes and not HTML nodes. As the documentation says, the .html()
method is not available on XML documents. oldIE will not easily import XML nodes into an HTML document. Also, oldIE doesn't support HTML5 so you'll need a shiv/shim which I assume you already have. But none of this is a bug and as far as I can tell things as working as documented.
Perhaps this will help explain the issues: http://www.alistapart.com/articles/crossbrowserscripting/
this is coffee script code that works perfect: