Archive

Posts Tagged ‘ajax’

QuickFix: jQuery $.getJSON() fails in IE6 & IE7

October 27th, 2009 15 comments

Had a nasty issue with jQuery + jSON + IEx just now – still at work because of it!

This bit of code works perfectly fine on Firefox and Chrome:

function onUnitsModified() {
            $.getJSON("<%=Url.Action("GetTotalUnitCount", "ProjectReaper")%>", null, function(result) {
                if(result > 0)
                  // Do stuffs here
                }
            });
            return true;
}

But in IE we’ve come to realise that the first hit is successful, future json requests ones are not hitting the ASP.NET MVC actions (I put a breakpoint). You could append a time stamp to get rid of this annoying caching bug, but alternatively you can use the ajaxSetup options to disable caching.

function onUnitsModified() {
            $.ajaxSetup ({ cache: false}); 
            $.getJSON("<%=Url.Action("GetTotalUnitCount", "ProjectReaper")%>", null, function(result) {
                if(result > 0)
                  // Do stuffs here
                }
            });
            return true;
}

Darnit! Hope someone else doesn’t waste their time trying to fix this now :-)

{lang: 'en-GB'}
Share

Foxy ladies: Mozilla releases Firefox 3.5!

July 1st, 2009 No comments

The moment we’ve all been waiting for, Mozilla has released the final version of Firefox 3.5 (which was originally slated to be 3.1). Amongst the highlights include the new Gecko 1.9.1 rendering engine and (from their release notes):

  • Available in more than 70 languages. (Get your local version!)
  • Support for the HTML5 <video> and <audio> elements including native support for Ogg Theora encoded video and Vorbis encoded audio. (Try it here!)
  • Improved tools for controlling your private data, including a Private Browsing Mode.
  • Better web application performance using the new TraceMonkey JavaScript engine.
  • The ability to share your location with websites using Location Aware Browsing. (Try it here!)
  • Support for native JSON, and web worker threads.
  • Improvements to the Gecko layout engine, including speculative parsing for faster content rendering.
  • Support for new web technologies such as: downloadable fonts, CSS media queries, new transformations and properties, JavaScript query selectors, HTML5 local storage and offline application storage, <canvas> text, ICC profiles, and SVG transforms.

For the developers, the Mozilla developer centre details the changes in this release. But the most exciting is the support for <video> and <audio> elements from the HTML 5 draft and the inclusion of the TraceMonkey JavaScript engine.

Download it now!

{lang: 'en-GB'}
Share

Wolfram Alpha Launches!

May 19th, 2009 No comments

Steven Wolfram of Mathematica fame (and pure genius) has launched Wolfram Alpha, its a ‘computational knowledge engine’ and quite a cool tool too! Taking on the big giants Google and Yahoo, Live etc, this bit of kit allows you to search using natural language.

Let me demonstrate, suppose you want to know who the prime minister of Bulgaria is, it will not only give you the answer but also some background information on the person.

Not only can you ask formal questions, but you can even give it some mathematical problems to solve.

tan(x^2+sin(x))

Try some of the examples on the right hand menu.

Some cool things to try,

Ok I could waste a day on this, so instead I’ll let you do it for me.

{lang: 'en-GB'}
Share

HOWTO: Running ASP.NET 2.0 Ajax Toolkit 1.0.x in .NET 3.5 / SP1 IIS

October 1st, 2008 3 comments

We had a bit of a dilema at work today, we just sent a version of a web application we’ve been working on for the past few months to staging (testing) to our client. Our client mentioned a move to .NET 3.5 is pending on the boxes there and that they need to ensure the products we ship are compatible. Should be right?

We use the Microsoft Ajax Toolkit throughout the product in question, which is totally rad! The last version thats for .NET 2.0 is 20229 released in late February 2008, however with .NET 3.5 SP1 System.Web.Extensions and System.Web.Extensions.Design are already included which elivates the need to _install_ the AjaxControlToolkit.msi on the server itself. The only thing is that we need to redirect all binding references to the newer 3.5 code by using <assemblyBinding> (within <runtime>) in the Web.Config also known as Assembly Binding Redirection.

Our web-server setup:

Product Setup:

  • ASP.NET 2.0 (3.5 still uses the .NET 2.0 ASP.NET engine)
  • AjaxControlToolkit – v1.0.20229.20821

Compiled with Visual Studio 2005 SP1.

Within the <configuration> elements in the Web.Config file, add the following:


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31BF3856AD364E35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

NOTE:
If your developer machines do not have .NET 3.5 SP1 installed then the above lines will need to be commented out as the CLR will fail to attempt to load newer versions.

Thats it! You dont need to update any assemblies or any other Web.Config settings.

{lang: 'en-GB'}
Share

Visual Studio 2008 Service Pack 1 & .NET Framework 3.5 SP1 Released!

August 12th, 2008 No comments

Finally after a long wait Microsoft have just RTM’d Visual Studio 2008 Service Pack 1 weighing in at a hefty 851Mb (ISO). The update also includes fixes for .NET Framework 3.5, which brings some cool new features to the table.

Visual Studio 2008 SP1 delivers:

  • Improved WPF designers
  • SQL Server 2008 support
  • ADO.NET Entity Designer
  • Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style ‘Ribbon’)
  • Visual Studio Team System Team Foundation Server (TFS) addresses customer feedback on version control usability and performance, email integration with work item tracking and full support for hosting on SQL Server 2008
  • Richer JavaScript support, enhanced AJAX and data tools, and Web site deployment improvements

The .NET Framework 3.5 SP1 delivers:

  • Performance increases between 20-45% for WPF-based applications – without having to change any code
  • WCF improvements that give developers more control over the way they access data and services
  • Streamlined installation experience for client applications
  • Improvements in the area of data platform, such as the ADO.NET Entity Framework, ADO.NET Data Services and support for SQL Server 2008’s new features

This effectively means the previous workaround for those who couldnt wait for SQL Server 2008 installation is redundant now that you can download a copy the final release!!! Yay for us!

If your like me and got down and dirty with pre-releases you’ll have to use the Microsoft Visual Studio .NET 2008 Hotfix Cleanup Utility first followed by the VS2008 Preparation Tool and try the installation.

{lang: 'en-GB'}
Share