I am starting to learn the chart.js library. I drew a pie chart (like “pie”). When you hover over the slices of the diagram, a number appears in the pop-up window that sets the size of the sector. How can you make this number still displayed at the top, where the sectors are listed (I marked this place with a
Tag: coffeescript
How to read BLOB data from a WebSocket which is not an image
I created a WebSocket connection to my webserver to receive some data. However, when I log the event that I receive in the onmessage function, then I cannot see the real content of the data. When I copy the network connection that my Chrome browser v32 opens as a curl command and run it on my OS console, then everything
A different way of handling this promise?
Here’s a little bit of CoffeeScript, but feel free to answer in JavaScript: Elsewhere, a view is listening for the add event on the collection: Sometimes the model hadn’t finished talking to the server, so it didn’t have an id and this code failed to do what was wanted. So, I wrapped the save in a promise using the when.js
Twitter Bootstrap tab shown event not firing on page load
In a page where I have n tabs, and the following script (coffeescript, I checked the compiled javascript and it seems to be ok)… Now, the ‘shown’ event does not fire on page load, so for the first tab being shown on the page there’s no way to handle this (ie: loading content via xhr) I tried adding this to
Why does an anonymous function get called, whereas a named function doesn’t?
I’m creating a CoffeeScript application that overlays a webcam video with a canvas element (this is just for context and doesn’t seem to relate to my problem though). To get the proper canvas size to overlay on the video, I attach an event handler function to the loadedmetadata event like this: This works nicely. However, my preference in this case
Get callback in CoffeeScript with library
I am using the YouTube API to embed a video on a page. I call swfobject.embedSWF which embeds the video on the page, it works. When it is done loading, the API is supposed to call onYouTubePlayerReady. My question though is where do I have to place the callback in my class to get the function called? Here is the
Remove a value from an array in CoffeeScript
I have an array: How could I check if “World” is in the array? Then remove it if it exists? And have a reference to “World”? Sometimes maybe I wanna match a word with a regexp and in that case I won’t know the exact string so I need to have a reference to the matched String. But in this