Comments (5)
jQuery version 2.1.0, browser version: Google Chrome 35.0.1916.153.
from jquery.
From http://api.jquery.com/jQuery/ -
When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as , <title>, or elements. As a result, the elements inserted may not be representative of the original string passed.
from jquery.
That seems a bit strange for me; you could argue the same for elements, but instead they are parsed by wrapping them up into something, so they are correctly transformed into DOM elements (see https://github.com/jquery/jquery/blob/master/src/manipulation.js#L33).
So my guess is that special cases like <HTML>
should also have their special strategy to be parsed.
from jquery.
If you have an idea how to fix this - please share it, we happy to consider any proper PR
from jquery.
@mjesun Keep in mind though that the need to create a full HTML document starting at a element is pretty rare. The cases you pointed out that we currently fix are not rare, and our attempts at fixing them are not bulletproof but usually sufficient. If you really need to create a full document, take a look at DOMImplementation.createHTMLDocument.
from jquery.
Related Issues (20)
- Feature Requests: Please read https://github.com/jquery/jquery/wiki/Adding-new-features Most features should start as pl
- Uncaught TypeError: Cannot read properties of undefined (reading 'createElement') HOT 1
- Event triggering is being captured incorrectly HOT 5
- CSP problem HOT 8
- AJAX with zero form fields does not send `Content-Type` header HOT 1
- manual triggering of pointer event
- jquery destructuring assignment HOT 3
- 网络安全漏洞修复 HOT 1
- Prepare a 4.0 blog post & an upgrade guide HOT 2
- Jquery upgrade from 3.6.0 to 3.7.1
- Cross Site Scripting (DOM) issue
- Treeveiw not woking with jquery 3.7.1 HOT 10
- DOM based Cross-Site Scripting (XSS) HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'createDocumentFragment') in jQuery 3.7.1 HOT 1
- Content-Security-Policy / nonce error in DOMEval HOT 2
- Facing jQuery Selector issue after upgrading from 1.7.1 to 3.7.1 HOT 1
- Jquery 4.0 beta? HOT 1
- jQuery .load function errors if loading html with auto-removing script tag HOT 2
- Strange error behavior of event delegation when customizing jQuery HOT 3
- invalid assignment left-hand side in jquery-3.7.1.min.js HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.