JSONP Simplified

JSONP is used to get data from remote web locations without running afoul of web browser security restrictions. Browsers prevent access to methods and properties from other domains, with one exception: the <script> tag.  The <script> tag is allowed to reference JavaScript from anywhere. For example, your browser will have no trouble with this script reference, no matter what domain the page is running:

<script  src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

Servers take advantage of this fact by returning JSON data wrapped in a JavaScript function. The link below asks flickr.com for some images in JSON format. Notice the last ...

JavaScript has been turning up everywhere. With nearly every desktop and mobile web browser on the planet coming equipped with a JavaScript engine, the language has become the de facto standard for client side code. There is just no better way to guarantee your audience can access the full feature set of your application.

Although JavaScript has typically been regarded as a client side technology, in-roads have been made in other areas in recent years. Frameworks like node.js are powering major server side applications and JavaScript can even be found querying some of the major NoSQL databases.

Here at Falafel ...
Polling AJAX is tricky. If the next interval triggers before the last AJAX request is complete, your app is doomed!! This creates a domino effect where your queue for requests fill up faster then it can complete. Your queue will NEVER finish... similar to an infinite loop.

In light of this, you should never put AJAX into a setInterval function. A clean, more robust option is this:

(function poll() {
    setTimeout(function () {
        $.ajax({
            type: 'POST',
            dataType: 'json',
            url: 'http://somewhere.com/rest/123',
            success: function (data) {
                MyNamespace.myFunction(data); //DO ...

Today, Falafel Software, the premier Consulting & Training company for Sitefinity worldwide, released a new version of its book “Sitefinity 5 Nuts & Bolts”.

 

The book is released for FREE for ALL of our current Sitefinity 4 Nuts & Bolts’ customers.  Just log into your account and download the new 5.0 book.
For all new customers purchasing the new Sitefinity 5.0 book, you will receive the 4.0 book as well plus all the source code for all the samples, modules and widgets.

Get your copy today and start enjoying the new Sitefinity 5 product while discovering many many new ...

In case you haven't heard.. JAVASCRIPT IS MAKING A COME BACK!! And it is not the same JavaScript you fiddled around with in the pre-AJAX era. It has become reborn with the help of HTML5, mobile, and even Windows 8 (see Create your first Metro style app using JavaScript). Understanding JavaScript is becoming essential and can no longer be dismissed as a "weakly-typed, toy language with no compilation checks," but instead as a versatile, dynamic, cross-platform language.

Before jumping into code and learning JavaScript, I want to give some background of its purpose. It is important to know ...

Stretching a RadGrid to 100% of the browser height can show as "squashed" when the grid is AJAX-enabled. Even without AJAX involved, stretching RadGrid requires setting the grid Height to "100%" and the Height style of all parent controls to "100%".  Setting RadGrid Height alone outputs this disappointing view where the data is squashed to a single text line.

You'll see this same "compact" view of the data in IE, FireFox ,Chrome and Safari. Add the style below to set HTML, Body and Form tags height to 100% and hide margin, padding and scrollbars.

<style  type="text/css">
    ...

Falafel Software is very excited to announce the addition of Basem Emara, widely acclaimed Sitefinity Guru, to the team!
Basem brings with him not only a well-known name and a unique track record in the Sitefinity community and consulting business, but also a very successful set of commercially available Sitefinity modules. Falafel Software is pleased to announce that these modules are now Falafel Software modules, available on the Telerik Marketplace and the Falafel store.
“With this acquisition, Falafel is firmly positioning itself as the leading Sitefinity vendor for consulting, training and off the shelf modules.” said Lino Tadros, ...

I came across an interesting behavior today. I was dynamically loading a user control into a RadTooltip using Page.LoadControl("MyUsercontrol.ascx")

Canceling the tooltip causes a partial-page postback. If I then reopen the tooltip before I do something to cause a full-page postback, the user control in the tooltip loads with the cached control state from the canceled instance. It appears that the second call to Page.LoadControl() returns an object with the same ID, and ASP.NET automatically wired it up.

My solution: in an event handler for the user control's Cancel button, I change the user control's ID to some throwaway text, like ...

If you're like me, you sometimes use AJAX controls in your web page. And, if you're like me, you find that when they fail to behave as expected, you as the user are not notified as to the reason. Instead, the page will just stare back at you blankly: no spinning globe, no twirling fox to indicate that it is processing your request. Of course, what's really happened is that your AJAX request caused an unhandled exception on the server and the request was canceled. If you're like me (and if you've read this far I am forced to conclude ...