In one part of my code, I call getContext('2d') on a canvas element to produce a CanvasRenderingContext2D object. That object goes on to get passed around a fair bit from function to function, and at a later point in the code it'd be handy to be able to get a reference to the original canvas dom element that produced a given context. I ...
This is related to http://stackoverflow.com/questions/3232518/how-to-update-vim-to-color-code-new-html-elements, but I want the syntax highlighter to only highlight the elements if it detects the html5 doctype at the first line of the file. Is there an easy way to do this?
...
Hello Stack Overflow!
I currently have a mind boggling error. I am using the .load function in jQuery to load images for a slideshow and getting a bunch of errors below by img tag that i am importing the url to. I have done my best to demonstrate my function and markup below. I do not get an error in any modern browsers but IE gives m...
I understand HTML5 off-line mode is not supported in Internet Explorer 8. Do we know if it will be in IE9?
...
Hi,
I'm looking into HTML5 and I'm puzzled why it goes so easy on well-formedness.
<div id="main">
<DIV ID="main">
<DIV id=main>
are all valid and produce the same result. I thought with XHTML we moved to XML compliant code at no cost (I don't count closing tags as a cost!). Now the HTML5 spec looks to be written by lazy coders ...
Hi,
I'm trying to implement a function as a part of a firefox add-on with canvas which gives the user the ability to draw.
function draw(event,context,drawit) {
var drawx = event.layerX;
var drawy = event.layerY;
if (!drawit) {
context.beginPath();
context.strokeStyle='rgb(0,255,0)';
context.lineWidth=1;
...
I feel like a complete klutz, I had this working and then I accidentally forgot to save it! I'm an idiot. I've spent the last day trying to recreate what I had but I can't do it. Basically (from my last save) I had this:
function canvasMove(e) {
if(!e) var e = window.event;
var downcheck;
var upcheck;
var leftcheck;
...
I'm designing am HTML 5 WebApp -- will use the local db storage, etc. It is targeted for AppPhones (iPhone and Android), and HTML 5 browsers. (IE and old browsers will get the old version of the site.)
Questions:
Is there a max download size for iPhone or Android native browsers?
Any limitations with PC-based browsers?
I also plan to...
I haven't seen any examples that do this. Is this not allowed in the api spec?
I am searching for an easy drag-drop solution for uploading an entire folder tree of photos.
...
Hi,
I'm searching for a good method to upload a canvas element from Firefox to a webserver or database to have the ability to reload it later.
My ideas:
1. my first idea was to use getImageData() and save the canvas as an ImageData object to the database, but this might not a good solution because these objets can get quite large.
2. s...
So I have a bunch of javascript to make some random points, and then connects them via a minimum spanning tree. That all works fine.
Then after that it draws the points and paths onto the canvas; and it draws an image like this:
- Randomly generated each time.
The problem I have with this, is that I'd like to have each of the circle...
I'm new to WebSocket and HTML5. Before today, I thought that all the HTML5 standards affect only the clients(broswers); so assume that users have upgraded their broswers, its ready. But after some reading on WebSocket, it seems to me that I need to install something on the server to support it. Am I understand it right?
As an example, i...
I am getting information from the browser using Javascript / HTML5 that I want to pass back into Sinatra and Ruby.
How can I pass this information back into Sinatra so that I can use it in other parts of my code?
...
Basically, I'm trying to do 3D projection on a 2D canvas with simulation of depth. As a general rule, bodies that are further away are "shaded" more and smaller than bodies that are closer to the viewer. The only thing missing is having bodies that are further away always drawn behind bodies that are closer.
Sometimes, bodies that are ...
import urllib2
from BeautifulSoup import *
resp = urllib2.urlopen("file:///D:/sample.html")
rawhtml = resp.read()
resp.close()
print rawhtml
I am using this code to get text from a html document, but it also gives me html code.
What should i do to fetch only text from the html document?
...
I am trying to draw two parallel lines on the canvas, but seems like properties of the latter overwrites the former. Please suggest what could be wrong :
<html>
<head>
<script type="application/javascript">
function draw() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
// draw a 10 pix...
I'm working on my first GM script, to replace the Flash previews on http://www.freesound.org with HTML 5 audio tags, and to add a download link to search results. I have the latter working fine, but I can't get the audio tag to display in Firefox 3.5.9. Here's my script:
// ==UserScript==
// @name FreeSound HTML 5 Preview
// @...
The old and superseded draft 75 of WebSocket specification doesn't specify HTTP request headers Sec-WebSocket-Key1 and Sec-WebSocket-Key2. Why does the latest draft include these, and what in terms of increased security?
...
I have this code, which shows the coordinates of the touch as the user drags his finger across the screen. The issue is that is I touch the screen for too long, it selects the entire canvas and displays the "copy" bubble, which is the default behaviour. How do I get rid of that?
<html>
<head>
<script type="application/javascript">
fu...
Hi all,
We are a new startup that is going to develop a web app for the Fashion industry. We were thinking of going with canvas (are not bothered about IE support) but now after reading about Raphaeljs and jQuerySVG, we are intrigued as to the possibilities of building the entire interface & units in SVG.
Here are the advantages that c...