Geeks With Blogs

News profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers

Donate Bitcoins

Check out Elapser from T3rse!
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD JavaScript
Angular Panel Discussion with Dan Wahlin, Jeremy Likness, John Papa, and Ward Bell
10 Reasons Web Developers Should Learn AngularThere is a very informative video discussing AngularJs, TypeScript, etc that is well worth your time. It got me interested and even excited about Angular and the possibilities. I’m a big fan of KnockoutJs, but this video gave me the bug to look into Angular more. Here’s a good article comparing KnockoutJs and AngularJS. Here are some notes from their discussion: They mentioned the cool demos at babylonjs.com. TypeScript pros and cons around 20 minutes ......

Posted On Monday, February 3, 2014 2:48 PM

Pointer Event W3C Specification
Our team was using hammer.js for touch events, mainly the tap event, but found some limitations in how we are using it. A colleague investigated more and decided we should use the Pointer Event Specification and Touch Event Specification contributed by Microsoft. It’s only in Candidate recommendation and only supported in IE10 and 11 (on 1/9/2014), but there is a polyfill for that called Hand.js. “Pointer events offer a way to unify handling mouse, touch, and pen input. This means that we can add ......

Posted On Thursday, January 9, 2014 3:38 PM

Referencing files TypeScript 0.9
I was trying to reference an existing JavaScript file from my new TypeScript file using /// <reference path="app.js"/> It wasn’t being found, until I found that you need to have the file saved as UTF-8. To do this in Visual Studio 2012 on Windows 7, click on file –> save as –> then click on the down arrow of the save button and choose save with encoding. TypeScript then found my JavaScript and started parsing. Now I have a lot of errors when I build the solution (other references aren’t ......

Posted On Friday, July 12, 2013 11:51 AM

Uncaught SyntaxError: Unexpected token u. file JavaScript Error in MVC
I was getting a JavaScript error that pointed to line number 1 of my MVC page. I have a form on the page and expected the Unobtrusive Validation to work with the Data Annotations. It took me a while to realize the validation messages weren't showing. After I while I found that I was missing the @Html.ValidationMessageFor(m => m.Name). Adding that for each field fixed it. My password reset with token example. I was missing line 12 and 17. 1: @using (Html.BeginForm("PasswordRe... "Home")) 2: { ......

Posted On Monday, May 20, 2013 1:45 PM

Include your JavaScript references in the correct order
I was stuck for 2 hours on this. I was using Wijmo library and was including the complete library before the open js file. I kept getting’Uncaught TypeError: Cannot call method 'formatString' of undefined’. Finally, I switched the order and put the open js file before the complete js file and the error went away. The lesson is that undefined means you haven’t defined it yet . Make sure it isn’t defined below it and that you didn’t forget to include it ......

Posted On Monday, January 7, 2013 3:51 PM

jQuery 1.9.1+ Ajax Post is Failing even though it has a 200 Status
I’m using my DataService and AjaxService for JavaScript and upgraded to jQuery 1.9.1. One of my post methods, which was working before, started hitting the deferred fail, instead of the deferred’s done, even though the status code was 200. This method is not returning any JSON to the caller. The 1.9 upgrade guide states “Prior to 1.9, an ajax call that expected a return data type of JSON or JSONP would consider a return value of an empty string to be a success case, but return a null to the success ......

Posted On Wednesday, May 8, 2013 9:41 AM

MVC Validation of a Password with a Regular Expression
I have requirement (specification) that the password has to be at least 7 characters long and contain a special character (~@#$&*()-_+=) which are all the specials in the number keyboard row. I found that using the RegularExpression DataAnnotations is really slick, but there was a point that caught me for a while. The problem is that @".*([!@#$&*()-_+=]+).*$" works in the UI, but fails in the unit test. @"[!@#$&*()-_+=]+" works in the test, but not in the UI (the MVC unobtrusive library ......

Posted On Friday, April 26, 2013 11:16 AM

DataService and AjaxService for JavaScript
Here is what I’ve been using to make my JavaScript more modular and testable. I’m using JQuery’s promises and the Revealing Module Pattern. I got the idea for the DataServices from John Papa's Pluralsight course on Knockoutjs, but modified it to work with promises, instead of passing in the callback as a parameter. // DataService example: dataService.UiDataService = (function (ajaxService) { 'use strict'; var webServiceUrl = "/api/UiApi/", /** * @brief Get all the components from the service. */ ......

Posted On Friday, April 12, 2013 8:54 AM

Jasmine Specification Testing Pointers
I’ve been using Jasmine JavaScript testing library for Behavior Driven Development (see my Benefits of BDD post) testing the last few months with KnockoutJs view models and the Revealing Module Pattern. We now have 244 specs on a system that will be around and hopefully expand. I was hired to get it going, then others will maintain it and add to it after I’m gone. They have helped me think through what needs to happen (when {X} it should do this), test functionality with out having to click through ......

Posted On Friday, April 5, 2013 3:18 PM

Making jQuery UI Droppable Testable
I’m using jQuery UI’s droppable for drag and drop capabilities. I wanted to be able to test it with Jasmine, but I couldn’t find a way to mock it. I found Jasmine jQuery, but wasn’t able to figure out how to spyOn or mock $('#jQueryElement').droppab... accept: function (d) { return accept(d); }, drop: function (event, ui) { drop(event, ui); } }); So I created a wrapper for this function. I’ve found that creating wrappers is an easy way to make things testable and to remove coupling to libraries ......

Posted On Tuesday, March 26, 2013 9:47 AM

Copyright © Aligned | Powered by: GeeksWithBlogs.net | Join free