Archive of JavaScript
-
CSS and JavaScript compression and bundling
Posted on June 20, 2010 by Frederik Vig in ASP.NET, CSS, JavaScriptIn the last post in Create an EPiServer site from scratch I go through some optimization tips and tricks from YSlow. One of these are CSS and JavaScript compression and bundling of files to create fewer HTTP...
Continue reading this entry → -
Creating a contact form with ASP.NET MVC
Posted on May 13, 2010 by Frederik Vig in ASP.NET, JavaScriptWe're going to create a contact form in ASP.NET MVC 2.0, that uses Ajax to send the form data and that uses client side validation to improve the user experience for our users. Start by creating a new ASP.NET MVC 2.0...
Continue reading this entry → -
Backup plan when loading the jQuery library from CDN
Posted on April 20, 2010 by Frederik Vig in JavaScriptIn most of my project I load the jQuery library from a CDN, either Google or Microsoft. This ensures that my page will load faster for my visitors, since the jQuery file will get sent to them from...
Continue reading this entry → -
Detecting Ajax requests on the server
Posted on April 6, 2010 by Frederik Vig in ASP.NET, JavaScriptIf you use jQuery or ASP.NET AJAX you can easily detect Ajax requests on the server by simply checking for the HTTP_X_REQUESTED_WITH HTTP Header. Both libraries automatically add this to the HTTP Header when they send a request. Here's a little...
Continue reading this entry → -
Font resizing and printing with jQuery
Posted on October 27, 2009 by Frederik Vig in JavaScript, Web designYou've probably seen the three A's on various websites, especially public sector websites; that you can click on to increase the font size on the web site. I'm personally not a huge fan of those. In my opinion it is...
Continue reading this entry → -
Extending search field with suggestion box
Posted on September 17, 2009 by Frederik Vig in ASP.NET, Code Snippet, EPiServer, JavaScriptDisclaimer: In this example I've kept the code simple to make it easier to read and to give you an idea of how you might approach something like this with EPiServer. This code should not be used in production scenarios...
Continue reading this entry → -
ASP.NET web forms and jQuery Thickbox plugin
Posted on July 13, 2009 by Frederik Vig in ASP.NET, JavaScriptUpdate Thickbox is no longer supported. Use another of jQuery's overlay/lightbox plugins. This post will remain for legacy purposes only. I'm very found of jQuery, and use the Thickbox plugin a lot in my project. I've not used...
Continue reading this entry → -
ASP.NET Validation and jQuery
Posted on May 21, 2009 by Frederik Vig in ASP.NET, JavaScriptRecently I was working on a simple form that used the ASP.NET Validation controls for validation. This worked fine when doing a regular Postback to the server with the data. However I wanted to use Ajax to make it a...
Continue reading this entry → -
Measuring JavaScript performance
Posted on May 10, 2009 by Frederik Vig in Code Snippet, JavaScriptAccording to Response Time overview, the response time for JavaScript code to execeute should be no more than 0.1 seconds (100 milliseconds). Especially on JavaScript/Ajax heavy sites this can be a problem. That's why it is always good thing...
Continue reading this entry →