Tag | Javascript Posts

Welcome back, in part 1 of Load and Web Performance Testing using Visual Studio 2010 I talked about why Performance Testing the application is important, the test tools available in Visual Studio Ultimate 2010 and various test rig topologies. In this blog post I’ll get into the details of web performance & load tests as well as why it’s important to follow a goal based pattern while performance testing your application. Tools => Options => Test Tools Have you visited the treasures of Visual ...
© 2011 By: Dov Trietsch. All rights reserved More Fun with Math The runaway student – three different ways of solving one problem Here is a problem I read in a Russian site: A student is running away. He is moving at 1 mph. Pursuing him are a lion, a tiger and his math teacher. The lion is 40 miles behind and moving at 6 mph. The tiger is 28 miles behind and moving at 4 mph. His math teacher is 30 miles behind and moving at 5 mph. Who will catch him first? Analysis Obviously we have a set of three ...
© 2011 By: Dov Trietsch. All rights reserved Adventures with JavaScript rendered in IE 8, Chrome 15, and Firefox 8.0 I have written a little monogram about the advantages of Math and wrote a few JavaScript applications to demonstrate them. I was a bit careless and used elements on the page in my JavaScript without using any of the GetElementsByXXXX methods to identify them. Say I had a text box named tbSeqNum into which I entered a number to be used in a computation. In my code I simply referred ...

O' Reilly are offering 50% off Javascript e-books at http://shop.oreilly.com/category/deals/hd-javascript-path.do

 

Today is the big day, the day I attempt to use Ajax in the app… I’ve never done this (well, tell a lie, I’ve done it in a ‘tutorial’ site, but that was a while ago now), so it’s going to be interesting.. OK, basics first, let’s start with the @Ajax.ActionLink Right, first stab: @Ajax.ActionLink("Click to get latest", "LatestEntry", new AjaxOptions { UpdateTargetId = "ajaxEntrant", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" }) As far as I’m aware, I’m asking to get the ‘LatestEntry’ ...
The problem: Images and other static files will not be cached unless you tell it to. In IIS7 it is remarkably easy to do this. Web pages are becoming increasingly complex with more scripts, style sheets, images, and Flash on them. A first-time visit to a page may require several HTTP requests to load all the components. By using Expires headers these components become cacheable, which avoids unnecessary HTTP requests on subsequent page views. Expires headers are most often associated with images, ...
Yes, I was. Recently, I’ve taken a good hard look at JavaScript. I’ve used it before but mostly in the capacity of web design. Using JQuery to make your web page do cool stuff is different than really creating a JavaScript application using all of the language constructs. What I’m finding as I use it more is that I may have been wrong about my assumptions about it. Let me explain. I enjoyed doing cool stuff with JQuery but the limited experience with JavaScript as a language coupled with the bad ...
In this Issue: Colin Eberhardt, WindowsPhoneGeek, John Papa, Jesse Liberty, Derik Whittaker, Sumit Dutta, Asim Sajjad, Dhananjay Kumar, Charles Petzold, Peter Kuhn, and Ollie Riches. Above the Fold: Silverlight: "Display Total Records After Applying PagedCollectionView Filter" Asim Sajjad WP7: "Announcing: Phone as a Remote Control" Peter Kuhn Metro/WinRT: "Asynchronous Processing in Windows 8" Charles Petzold Shoutouts: Michael Palermo's latest Desert Mountain Developers is up Michael Washington's ...
In this Issue: Andrea Boschin, Mark Monster, Antoni Dol, Chaitanya Venneti, Erik Arthur and Jeffrey Ferman, David Kelley, Jose Fajardo(-2-), Andy Beaulieu, Rudi Grobler, Chad Campbell, and Andrej Tozon. Above the Fold: VS2011: "Visual Studio XAML Designer: New Grid Features" WP7: "Statistics for your Windows Phone application (Google Analytics)" Mark Monster Metro/WinRT/Windows8: "Physics Games: Multi-targeting Windows 8 + Windows Phone 7" Andy Beaulieu Shoutouts: Michael Palermo's latest Desert ...
Last week I pushed a new application up to production, and started hearing complaints of a memory leak. After running some diagnostics I learned two exciting things: http://bugs.jqueryui.com/ti... The current version of jQuery UI (1.18.16) has a memory leak with the DatePicker control - including the DatePicker control as part of the jQuery UI is all it takes to cause memory to be allocated and never returned until the browser is closed. Every refresh of the page, or every time a new page is ...


This post has been moved to my new blog.

The new URL is: http://dwdii.github.io/2011/10/23/Using-HTML5-Canvas-tag-for-Simple-Video-Animation.html.

Unfortunately, I am unable to redirect you automatically due to limitations of this blogging engine. :-(
I've been working on an HTML5 application called Virtual Hamronograph. Since JavaScript can't save to the local file system I use localStorage to allow users to save harmonographs. I find this to be a good alternative. If you don't know, localStorage is a new global object in HTML5 that allows you to save up to 5MB of data in the browser. You save values by calling localStorage.setItem(key, value). You get values by calling localStorage.getItem(key). You can remove items by calling localStorage.removeItem(key). ...
UPDATE The below sample just showcases the locality sample. The complete set of attributes exposed which include PostalCode, CountryRegion, Address etc., are available at http://msdn.microsoft.com/e... This is the third in the series of posts I am doing on HTML5 for ASP.NET Developers Geolocation is one of the popular features of HTML5 that’s being touted as a favorite for building location aware applications. It helps to a great extent not just for Web Applications that run ...
This would be the first in the series of posts I plan to do for HTML5 for ASP.NET Developers The first thing that everyone would have experienced is the HTML5 header tag. The regular header tag that Visual Studio creates for ASP.NET Webforms is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml... This would be the header tag present in the Master Page or the actual ASPX Page when you don’t inherit from a Master Page. Till HTML5 specifications ...
Today post will show you how to build an Ajax form with JQuery validate supporting (unobtrusive) client and server side validation using ASP.NET MVC 3. If you want to see an examples, you can visit this post about Ajax in ASP.NET MVC 3. To enable (unobtrusive) client side Ajax and validation support include the following JavaScript files (in Views/Shared/_Layout.cshtml): javascript" src="@Url.Content("~/Script... <script type="text/javascript" src="@Url.Content("~/Script... ...
I've wrote this article a few months ago but in Portuguese: http://pontonetpt.org/blogs... I've decided to translate it to engish. The sample project is hostead at GitHub but it's in Portuguese (the same as my first article). Link Github: https://github.com/guilherm... I've been progamming with unit testing and test-driven developement in use for server-side for 2 years. On the last months i've been working ...
In my particular case the problem was due to Silverlight. I have my ASP.NET MVC application which is incorporating a Silverlight application into it. When integrating the Silverlight application VS will ask you if you want to allow for debugging your Silverlight application. Selecting yes will enable the Silverlight debugger in your web applications project settings (see below): To allow JavaScript debugging again simply uncheck the Silverlight checkbox and start your application ...
KnockoutJS is an awesome MVVM JavaScript data binding framework for building rich user experiences. As sites get more interactive and more presentation logic gets pushed to the client-side, it’s important to have rich frameworks which enable these scenarios. The next version of MVC is going to include the Knockout NuGet package in the box. Now is a perfect time to start learning Knockout. As I’ve been learning Knockout, I’ve been pleased to discover that, although it comes with a rich set of features ...
OOook, those who know me, or have read my blog probably have a pretty good idea that I’m a silverlight, wpf, wcf, c#, xamly kinda guy. I’ve never really done anything webby, the closest I’ve gotten is doing a bit of backend stuff, well, times change, and quite frankly I wanted to do something new… soooo I’ve opted to go down the MVC route, for two main reasons – 1, I figured I may as well learn a good framework, 2, Matt Abbott told me that MVC lets you get dirty with HTML, and that’s one of the things ...
Hello, I've been playing around with paging in data form webpart. I thought ( well someone actually asked me ) about how to add a "Last Page" link to the paging in the webpart. So, I've not tested it a lot, but it may help. Add this xsl variable inside the ms-paging td: <xsl:variable name="PagesNumber" select="ceiling($dvt_RowCount div $RowLimit)"/> And add this anchor tag in the place you want it to be: <a> <xsl:attribute name="href"> javascript: <xsl:value-of select="ddwrt:GenFireServer... ...
One tries to be a responsible citizen and report malicious behavior to the “appropriate authorities.” Of course, in the end, it’s really about filling out forms and being told to go fuck yourself. After filling out their forms, they said: The Microsoft Malware Protection Center (MMPC) strives to keep you informed about the status of your submission. This email communicates what we currently know about the file(s) you submitted. You can view your submission online at http://www.microsoft.com/se... ...
Sometimes, when working with JavaScript, we need to write a confirm dialog or message box to display some informative data. We can either use JavaScript alert function or confirm function for such operations. But in order to make a nice UI, we can resort to JQuery UI dialog, which gives a nice chrome window. But settings that up is not a one liner task. In this article, I will present a small plugin which will help us display some basic dialog just to get the job done without too much code.Read More ...
I have been so busy with programming and project management, that I forgot all about this blog. I still get plenty of challenges and interesting issues every other day. I think it's time to start blogging about it. Just an update, I have moved to full ASP .Net web developement in the past few years, so no more WinForm stuff from me, except that Telerik Controls suck, and they have an unbelievable overhead and plenty of memory leaks. That's also true for their ASP .Net controls. It's horrible! For ...
When a user post's data to the server, the page will be reloaded. When the user hits the F5/refresh button, a message appears, which tells us, that we´ve allready sended the data to the server. And asks us if we want to sent it again. If the user clicks "yes", we have to catch that, we don´t want this in our application - check that the user can only post something every 2 minutes. - save the posted data in viewstate and check if something changed - ... Or we can check if the user hit the refresh ...
Introduction Just the other day I blogged about “Enabling Frame Rate Counter for XAML Applications in Windows 8”. At the very end of that post, I reminded everyone that that method does not work for HTML / JS Metro Applications. But, we are in luck as Mathias Jourdain provided sample code for accomplishing this in HTML / JS in his Build talk. The only problem was that he didn’t describe how to hook this into a new application to actually use. That is going to be the focus of today’s blog post. Let’s ...
Well, as mentioned in my earlier posts, the ASP.NET MVC 4 has Developer Preview has been released. You might notice quite a bit of this term “Developer Preview” in 2-3 products specifically. One, Windows 8 is now available as simply Windows Developer Preview. Similarly, Visual Studio 11 is Developer Preview and also the Internet Explorer Platform Preview 3 is a Developer Preview, as with the case with Expression etc., Now, to clarify on a few things which I learnt. The Windows 8, hereinafter referred ...
So its been a few weeks since Microsoft’s Build conference, where they unveiled Windows 8 and shared what the developer story will be. I had blogged about Day 1 of the conference here, but I wanted to share some video I took with my colleagues Winson Woo and Jim Russell as my thoughts now that a bit of time has lapsed. So first, a video captured right after we got our hands on the Samsung tablet given to all attendees. Yes the tablet is nice, but this conference is all about the OS. Windows 8 as ...
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; ...
Saturday, November 5, 2011 at the AT&T Foundry in Plano, TX Dev-ing. Mobile. Cloud. APIs. Good food. Awesome prizes. Interested in building your own app? This hackathon will introduce you the the latest cutting edge tools to deploy your own app with a website backend, fully hosted in the cloud. Alternatively, you can come pitch your idea and scout for developer talent, who can help you build your app! Mobile App Hackathon is an event produced by the AT&T Developer Program and Apigee that ...
For more formatted view .. Goto http://ankitagrawal57.blogs... any web application, performance is basic necessity. Earlier internet speed used to be limited thus users got inclined to pages which load within 3-4 secs. But now the internet speed is no more a constraint but still time does remain a constraint. Imagine yourself visiting a website which takes a lot of time (30 – 60 secs) just to load the page. You would not like to go to that site again.To mitigate this issue, developers and ...
So someone moved your Silverlight cheese? Go and get some HTML5 cheese! Before WPF/E & Avalon were anything more than vapourware, W3C had the SVG standard(Scallable Vector Graphics) for 2D vector graphics over the web. Using Javascript, you could manipulate 2D animations & tranforms. You can embed SVG in HTML5 today. Yeah, its like going back to Silverlight 1.0, but you just have to deal with it! Embrace change. SVG Features · Designed for 2D graphics - display vector graphics & text ...

<script type="text/javascript" language="javascript">

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(refresh);

        function refresh() { //Your code here; }

</script>

 

Source

Last week, Microsoft held their long awaited Build Windows (or simply "Build") conference in Anaheim CA. About 5000 people packed the convention center to discover the latest version of the Windows operation system: Windows 8.

Read the rest of this entry »

As I write this post, Microsoft’s Windows 8-focused //build/ conference has just ended. The apprehension so many developers had around the show is now dissipated, the developer platform and tools have been detailed, and we have all been able to work with the operating system, and develop apps for it, on a touch device, for about 72 hours now. Most people, myself included, like what they saw. The OS is touch-friendly without being an iOS copycat; our developer skill set investments are nicely protected; ...
Programming for Metro Metro is the future http://zd.net/rnT9VZ .NET is for old apps. WinRT replaces WPF & WCF. XAML is big. There were no Silverlight sessions. HTML 5 and Javascript ( Blend for HTML) are back in fashion – I wont dwell on this because web apps are (inconsistently) simplistic in concept and over-complex in development. Yes, all those XAML skills are portable, Silverlight (RIP) apps can run as Metro apps with a bit of fidgeting with namespaces – you just need to know what controls ...
The Visual Studio 11 Developer Preview was released to MSDN subscribers yesterday, and will be available in general release tomorrow (9/16). There's way too many new features to list them all here (for all the product highlights go to http://msdn.microsoft.com/e... but here are a few that interest me the most: Enhanced multi-monitor support .NET Framework regular expression syntax in Find and Replace IntelliSense enhancements for JavaScript JavaScript breakpoints ...
So we’re into Day 2 of Build, and the keynote this morning is talking about server and cloud aspects of Windows 8. I’m looking forward to the sessions this afternoon to get some deeper dives. But let’s reflect over yesterday first – Build Day 1. Yes, there was a tablet given away. But those focusing on the “new toy” are missing the bigger message, the larger paradigm shift, the impact on the future of what we’re seeing. I sound melodramatic saying that, but its true – the way development for the ...

As usual when I attend a conference, I like to take quick notes to remember what it was all about and take some time later to analyze it. Since Windows 8 is going to be the next big things, let me share my notes with you!

Read the rest of this entry »

We want to dynamically show an image below a span html element. The javascript creates a div element, than assigns new offsets using jQuery offset() and then appends the div to document.It worked as expected in FireFox, but moved the new element to the bottom of the page in IE.I found, that if I will call offset after document.body.appendChild, it will assign values correctly.In the test page below if offset is called after document.body.appendChild, new img assigned left: -8, top: 110img left: -8, ...
Recently I attended Microsoft HTML5 WebCamp where I had a chance to get insights on all new features HTML5 has to offer. Couple things to mention: - Canvas - a new HTMl5 feature that uses JavaScript to draw bitmap graphics on a web page. Simple approach (less JS coding) makes this interesting: empty space is treated as a painter canvas and a painter brush is replaced with JavaScript. - SVG (Scalable Vector Graphics) is another graphic tool widely publicized. It is not new, it has been around for ...

At  http://oreilly.com/javascript/index.html, O'Relly have put up a page of JavaScript Development and Resources. It includes many free book sample chapters.

 

Recently I implemented a rather complex page allowing the user to input pairs of colors and quantities, with some relatively "odd" validation rules. I knew that I probably wanted to implement the page entirely with javascript and probably jquery templates, but for a demo I just needed a quick prototype of the page, so to get that done I threw together a quick and dirty webforms page using the telerik radgrid to display the data, but not save & validate. Took me maybe 2 hours including some basic ...
Today's $10 Deal of the day from APress at is "jQuery Recipes A Problem-Solution Approach". "jQuery is one of today's most popular JavaScript web application development frameworks and libraries. jQuery Recipes can get you started with jQuery quickly and easily, and it will serve as a valuable long-term reference. " ...
At http://99-bottles-of-beer.n... an old drinking song that printed out by an award-winning piece of code obfuscation cited in a Wikipedia article at http://en.wikipedia.org/wik... inspired a comparison of programs written in various languages to print this song. The Cobol (and to a lesser extent C#) programs were easy to understand whereas other languages such as J*** were not. There was even a highly obfuscated one in JavaScript! At http://blogs.msdn.com/b/alf... ...
Today, O' Reilly are offering three book deals: 1) JavaScript Web Applications Use discount code: DD388 $13.99 (Save 50%) 2) Programming Microsoft ASP.NET 4 Use discount code: DDGRM $23.99 (Save 50%) 3) Big Data Now: Current Perspectives from O'Reilly Radar Price: FREE! (this third book is not available as a PDF so download one of the following readers) http://www.mobipocket.com/e... https://addons.mozilla.org/... Can't code withoutIn-depth ...
Issue: Use the .Net JavaScriptSerializer to serialize an object but due to circular references need to prevent from those properties from being serialized. Solution: In order to ignore certain properties from getting serialized, simply add the ScriptIgnoreAttribute attribute to the property: [ScriptIgnore] public virtual MyClassCausingCircularRefError MyProperty { get { return _privateField; } } ...
I recently delivered a Zeollar session on Using HTML5 Local Storage in ASP.NET Applications Following it up with a blog post on the contents, since a few mentioned that the code was not better aligned/readable. Local Storage and Offline Web Applications are 2 promising features of HTML5 going around the web apart from the (already tired of?) Videos. Local Storage (persistent storage) is not entirely new since we had cookies ever since sliced bread (or seems to be so). But, the limitation of 4KB on ...
I am a reformed former JavaScript hater. In the 90s and early 2000s I muddled through JavaScript compatibility issues, poor performance and a lack of development & debugging tools. When ASP.NET came out, promising to hide me from the complexity of browser incompatibilities, I fully embraced server-side web development. This approach may have worked in 2002, but it does not today. The world's expectations have been reset by Ajax, Google Maps, mobile web sites, high performance JavaScript engines, ...
Rich internet applications are growing fast in the business and enterprise application landscape as more and more software managers and corporate decision makers are electing to place rich internet applications (RIA's) into their organizations. But with the many advantages of rich internet applications over the client/server deployments, organizations also find many new aspects they need to master and overcome - one of them is understanding the new security vulnerabilities of the rich web based applications ...
Issue: Due to an upgrade from .Net 2, 3.0 or 3.5 to .Net 4.0 or you are starting a new .Net 4.0 project, you may run into this message: A potentially dangerous Request.Path value was detected from the client Or A potentially dangerous Request.Form value was detected from the client Environment: .Net 4.0 MVC 3 (could be MVC 2 also because of the controller/action action filters that are available) Fix: Lets tackle the first issue: A potentially dangerous Request.Path value was detected from the client ...