Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Wednesday, October 23, 2013

What is JSON Binding?

What is JSON Binding?

MVC 3 included JavaScript Object Notation (JSON) binding support via the new JsonValueProviderFactory, enabling the action methods to accept and model-bind data in JSON format. This is especially useful in advanced Ajax scenarios like client templates and data binding that need to post data back to the server.

What is Unobtrusive JavaScript?

Unobtrusive JavaScript is a general term that conveys a general philosophy, similar to the term REST (Representational State Transfer). The high-level description is that unobtrusive JavaScript doesn’t intermix JavaScript code in your page markup. For example, rather than hooking in via event attributes like onclick and onsubmit, the unobtrusive JavaScript attaches to elements by their ID or class, often based on the presence of other attributes (such as HTML5 data- attributes).

It’s got semantic meaning, and all of it — the tag structure, element attributes, and so on — should have a precise meaning. Strewing JavaScript gunk across the page to facilitate interaction (I’m looking at you, __doPostBack!) harms the content of the document.

Thursday, September 9, 2010

Get file extension using JavaScript

Get file extension using JavaScript



function getFileExtension(filename) {
            var ext = /^.+\.([^.]+)$/.exec(filename);
            return ext == null ? "" : ext[1];
        }
function fun_flash(name) {
            var extension = getFileExtension(name);
            alert(extension);
            if (extension == 'swf') {            
                alert("flash");
            }
            else {              
                alert("image");
            }
        }     

Tuesday, August 31, 2010

Scrolling Title Effect

Scrolling title effect using javascript