The jQuery Globalization plugin becomes “Globalize”
Posted: July 8, 2011 Filed under: Uncategorized | Tags: ASP.NET, JavaScript, jQuery 4 CommentsThe jQuery Globalization plugin originally developed by the ASP.NET team and donated to the jQuery project, has found new life as the “Globalize” JS library.
This new library is maintained by the jQuery UI team but no longer has a dependency on jQuery. It is completely standalone, meaning you can use it with any JS library or environment you like. That’s very cool.
Moving forward, the jQuery UI library will utilize Globalize for providing globalization of the its widgets, and expose an API interface that can be met by Globalize while encouraging widget authors to utilize this API to ensure any widget can be globalized in the same way, with or without globalize.js as a depedency. That’s cool too.
The library includes culture information for ~350 cultures. That’s quite a lot. And an interesting fact: these culture files are generated from the culture info in the .NET framework. That’s especially cool.
You can grab globalize.js and the desired culture files from its home on the jQuery github account. It’s currently in “in development” status at version 0.1.0a1. You can read more about plans for its development and further releases on its jQuery UI wiki page.
Access Key Highlighter plugin for jQuery now available
Posted: April 19, 2009 Filed under: Uncategorized | Tags: accessibility, JavaScript, jQuery 20 CommentsI’ve just published my first jQuery plugin release. It’s a port of my Access Key Highlighter control for ASP.NET AJAX that I released last year. I’ve rewritten the control for jQuery and plan to implement new features in both versions of the control from now on. You can see a live demo of it running at http://files.damianedwards.com/KeyTips/
If you have any feedback or feature suggestions go ahead and leave a comment here.
Setting up jQuery for ASP.NET Web Forms projects
Posted: March 28, 2009 Filed under: Uncategorized | Tags: ASP.NET, JavaScript, jQuery 2 CommentsDuring my recent presentation to the Victoria.NET DevSIG on jQuery, I talked about how to get started using jQuery with ASP.NET Web Forms projects. Part of this was around how I like to set up my projects with jQuery to take advantage of the script management features that ASP.NET & Visual Studio 2008 provide out of the box.
ASP.NET provides support for switching in different versions of your JavaScript files at runtime depending on the compilation setting in your web.config file (debug=true or false) via the ScriptManager control. This allows you to have your development script used during development & debug time, and an optimised script (minimised, obfuscated, etc.) used at release time. You can enable this feature of the ScriptManager with your own files (it does it automatically for the MS AJAX framework files) in a few ways, the easiest of which is to set the ScriptMode property of your ScriptReferences to Inherit.
<asp:ScriptManager runat="server"> <Scripts> <asp:ScriptReference Path="~/script/myScript.js" ScriptMode="Inherit" /> </Scripts> </asp:ScriptManager>
Further to this, Visual Studio 2008, by way of a hot fix, adds support for a third type of JavaScript file, used only for providing JavaScript IntelliSense within the Visual Studio IDE. These special versions of your script files (known as “VSDoc” files) are carefully constructed to ensure optimal IntelliSense relevance, information & performance and generally are not able to be used at runtime at all.
So we have three file types in all as follows:
- Release mode file: myscript.js
- Debug mode file: myscript.debug.js
- VSDoc file: myscript-vsdoc.js
When you download jQuery, you have the option of the standard file (jquery-1.3.2.js at time of writing) as well as the “production” file, which is minimised (jquery-1.3.2.min.js). Microsoft have also contributed a VSDoc file which you can download from the official jQuery source repository on Google Code.
So there are three types of jQuery files that match up with what ASP.NET & Visual Studio support, just two of them have the wrong extension. All we need to do is rename the files to match the features in the platform & tools:
- jquery-1.3.2.js => jquery-1.3.2.debug.js
- jquery-1.3.2.min.js => jquery-1.3.2.js
I have this files in a location on my hard drive where I can always get to them for new projects:
To use them in a project, just create a folder to hold them and right-click in solution explorer and choose Add –> Existing Item…
Now simply add a script reference for the jQuery files in the same way as you would for your own script. ASP.NET will use the large debug version when the app is in debug mode & the minimised version when it isn’t, plus you’ll get great IntelliSense support from Visual Studio 2008:
<asp:ScriptManager runat="server"> <Scripts> <asp:ScriptReference Path="~/script/jquery-1.3.2.js" ScriptMode="Inherit" /> <asp:ScriptReference Path="~/script/myScript.js" ScriptMode="Inherit" /> </Scripts> </asp:ScriptManager>
It would be nice if the next version of ASP.NET included support for jQuery’s default file extensions in the ScriptManager control, but until then this works very well.
Speaking at VIC.NET SIG next week on jQuery
Posted: January 24, 2009 Filed under: Uncategorized | Tags: ASP.NET, JavaScript, jQuery, Presentations 6 CommentsI’ll be speaking at the Victoria.NET SIG meeting next week in Melbourne about jQuery. Come along if you want to learn about what jQuery is and how it can help you in your ASP.NET applications. RSVP details below.
jQuery: The way JavaScript should be
Thursday 29th January 2009
5:30pm (Pizza and drinks served); 6pm (presentations start)
Microsoft Theatre, Level 5, 4 Freshwater Place, Southbank
Hate the thought of writing JavaScript? Get frustrated by cross-browser DOM quirks? Ever wondered how those spiffy sites do that animation without Flash or Silverlight? Think that JavaScript isn’t a real programming language? Well come and see how jQuery makes writing JavaScript fun again. Microsoft is now shipping and supporting jQuery, an open-source JavaScript library, with ASP.NET and Visual Studio. jQuery is fast, lean, simple and hugely expandable, to enable you to build the most compelling web applications quickly and easily.
About the speaker:
Damian Edwards has presented at several Usergroup meetings, community events and Tech Ed on a wide range of topics. He is also a Microsoft MVP who specialises in ASP .NET and Web Front end development.
If you are planning on coming, please RSVP to help us organise drinks and catering.
To register, simply send an email to info@victoriadotnet.com.au. It is a FREE event and there is no charge for attendance but space is limited so you’ll need to let us know you’re coming so we can make sure there’s space. If you do not wish to receive event notification mails in the future, simply send a mail to info@victoriadotnet.com.au with the word Unsubscribe in the subject.
Twitter Account and other SIGs:
The user group has a Twitter account. You can follow the happenings in the group at http://twitter.com/vdnug
The Victoria .NET Dev SIG usually meets on the second Tuesday of every month to discuss developer related .NET topics. Victoria .NET also runs an Office and SharePoint group called MOSSIG (that meets on the 4th Wednesday of every month) and a SQL SIG (that meets 12:30-2:00pm on the 2nd Monday of each month) to discuss topics related to SQL Server development and a new Silverlight Developer and Designer Network user group