cpag
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Widget Responsive for Youtube] Encode the URL in the "src" attributeThanks.
But you know, after the HTML code is parsed by the browser, all invalid “&” are fixed and the JavaScript code from Youtube can’t see any difference. This option shouldn’t be an option. Really, it is just a best practice to respect the standard.
For example, this code displays the same URL twice:
<!doctype html> <html><body> <iframe id="player1" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com" frameborder="0"></iframe> <iframe id="player2" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1& amp;origin=http://example.com" frameborder="0"></iframe> <script> var p1 = document.getElementById('player1'); var p2 = document.getElementById('player2'); alert(p1.getAttribute('src') + "\n\n" + p2.getAttribute('src')); </script>But OK thank you for the option.
Forum: Plugins
In reply to: [Widget Responsive for Youtube] Encode the URL in the "src" attributeHere is the documentation : https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player .
They just forgot to escape. All HTML attributes must be escaped, the right way is the standard from W3C. Try to validate a page with your plugin : http://validator.w3.org/ . Your plugin makes invalid Web pages.
Viewing 2 replies - 1 through 2 (of 2 total)