Tag Archives: html

Jquery and HTML FormData returns “Uncaught TypeError: Illegal invocation”

Questions: I’m using this script to upload my image files: http://jsfiddle.net/eHmSr/ $(‘.uploader input:file’).on(‘change’, function() { $this = $(this); $(‘.alert’).remove(); $.each($this[0].files, function(key, file) { $(‘.files’).append(‘<li>’ + file.name + ‘</li>’); data = new FormData(); data.append(file.name, file); $.ajax({ url: $(‘.uploader’).attr(‘action’), type: ‘POST’, dataType: ‘json’, data: data }); }); }); But when I click in upload button, the JavaScript… Read More »

Replace HTML page with contents retrieved via AJAX

Questions: I have an HTML page with a typical structure: <html> <head> <script src=”…” ></script> <style>…</style> </head> <body> content </body> <script> var success_callback = function(data) { // REPLACE PAGE CONTENT & STRUCTURE WITH “data” } ajax(url, params, success_callback); </script> </html> Do you think it is possible ? I’ve already tried to give the html tag… Read More »

jQuery .load() call doesn't execute JavaScript in loaded HTML file

Questions: This seems to be a problem related to Safari only. I’ve tried 4 on Mac and 3 on Windows and am still having no luck. I’m trying to load an external HTML file and have the JavaScript that is embedded execute. The code I’m trying to use is this: $(“#myBtn”).click(function() { $(“#myDiv”).load(“trackingCode.html”); }); trackingCode.html… Read More »

Ember.js + HTML5 drag and drop shopping cart demo

Questions: In short, I am trying to reproduce a basic version of jquery-ui’s shopping cart demo: http://jqueryui.com/demos/droppable/shopping-cart.html with ember.js and HTML5 native drag n drop. After previously trying to implement drag and drop with ember + jquery-ui and having difficulty using this solution: http://jsfiddle.net/Wu2cu/2/, I saw pangratz’s HTML5 solution: http://jsfiddle.net/pangratz666/DYnNH/ and decided to give it… Read More »

HTML 5 w3c validation

Questions: I validated my website using validator.w3.org It reported the following error: Line 5, Column 67: Bad value X-UA-Compatible for attribute http-equiv on element meta. <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″ > If I don’t include that META tag, than all IE9 visitors will see my website in Quirks mode, and I want to prevent that. Any help… Read More »

Is it possible to play shoutcast internet radio streams with html5?

Questions: Is it possible to play shoutcast (or some) internet radio streams with html5? So I have next code: <html> <body> <audio src=”http://shoutcast.internet-radio.org.uk:10272/” /> </body> </html> I save it as HTML page and start my browser (Google chrome 4.0.249.78, safary or FF) But it does not play/work!( And it does not play with any other… Read More »

Clicking HTML 5 Video element to play, pause video, breaks play button

Questions: I’m trying to get the video to be able to play and pause like it does YouTube (Using both the play and pause button, and clicking the video itself.) <video width=”600″ height=”409″ id=”videoPlayer” controls=”controls”> <!– MP4 Video –> <source src=”video.mp4″ type=”video/mp4″> </video> <script> var videoPlayer = document.getElementById(‘videoPlayer’); // Auto play, half volume. videoPlayer.play() videoPlayer.volume… Read More »