Browse by Tags
All Tags »
Javascript »
Tips & Tricks (
RSS)
Quick Tip – Deleting a JavaScript Object Property Lately, I’m writing a JavaScript library which I’ll publish and write about in the near future. On the meanwhile, during the development I had to delete a property on a JavaScript object that I’ve created. Since JavaScript is a dynamic language that operation is available and is achieved through the delete operator. This post will describe the JavaScript delete operator and how to use it. The JavaScript Delete Operator The delete operator is used...
Back to Basics – JavaScript onerror Event The JavaScript window.onerror event is a very useful event that I find very strange that sometimes client-side developers don’t know. The event is fired most of the times (yep not every time) an error occurs in a JavaScript code. You can wire a handler to the event that will help you to prevent errors from bubbling to the browser or to send the errors to some logger for further investigation. The onerror Event The window.onerror is an event handler for error...
Quick Tip – Converting JSON Serialized .NET DateTime to JavaScript Date When you are using the controller JSON method in ASP.NET MVC or scriptable WCF services you sometimes have to serialize a .NET DateTime property. The DataContractJsonSerializer will serialize it into the following format: /Date(1235398665390)/ This format indicate to the client side parsers that the data fragment that was sent is a date representation. But how can you convert it to a JavaScript Date object? There are a few methods...