Skip to content

Author: admin@master

HTTP Content-Type Header and JSON

I have always been trying to avoid using most of the HTTP protocol’s properties for the sake of fear of the unknown. However, I said to myself that I’m going to face fear today and start using headers purposefully. I have been trying to send json data to the browser and use it right away. For exam…

Size to fit font on a canvas

I currently have this http://jsfiddle.net/dgAEY/ which works perfectly, I just need to figure out a way to size the font when it gets too long. I’ve looked into Auto-size dynamic text to fill fixed size container and I’ve tried to apply the Jquery function they posted but I couldn’t get it t…

Add class to parent element

I know this has been asked many times before, but I could not find anything that worked. I will need to add a class to a div that gets autogenerated over my ul. This is my html code: I need to add a second class to div class “wrapper”, but after what I have tried I can’t get it to

Break on NaN in JavaScript

Is there any modern browser that raises exceptions on NaN propagation (ie multiplying or adding a number to NaN), or that can be configured to do so? Silent NaN propagation is an awful and insidious source of bugs, and I’d love to be able to detect them early, even at a performance penalty. Here’s…

Detect empty value on prompt

How to detect an empty value when user presses ok on prompt (and previously empties the prompt field)? I need to overwrite the old value with the new (empty) value. I’m doing this: Currently it returns null if user empties value and clicks ok. But at the same time I need to check for null value because …

Disable weekends in magento date picker?

I would like to disable the weekend (saturday and sunday) in Magento default date picker. Is it possible in magento date picker? Also i would like to disable the some other day’s based on the store holiday’s. So is this options as possible to do in Magento date picker. Answer I have not tried this…