Monday, 24 June 2013

iis web site host local network


  in windows 7 your Firewall needs to be configured to accept incoming calls on TCP Port 80
  1. go to windows firewall with advance security
  2. Inbound Rules -> Action -> New Rule
  3. select Predefined radio button and then select the last item - World Wide Web Services(Http)
  4. click next and leave the next steps as they are (allow the connection)

Saturday, 22 June 2013

Detect changes in the DOM

              Event is call when any modification in document object model
               ( like  div or input are added to the html)

            $(document).bind('DOMSubtreeModified', function () {
                console.log("hi");   // for FF 3+, Chrome
            });

            $(document).bind('DOMNodeInserted', function () {
                console.log("hi");  // for FF 2, Safari, Opera 9.6+
            });
           
            $(document).bind('DOMNodeRemoved', function () {
                console.log("hi");  // for FF 2, Safari, Opera 9.6+
            });

Tuesday, 11 June 2013

Change the hash without calling actions inside Backbone.Router

var Router = Backbone.Router.extend({
    routes: {
        'Registration': 'Registration'    },

    Registration: function() {
        console.log('Registration() called')    }
})
var router = new Router()

Backbone.history.start()

// here the Registration() action is called
router.navigate('Registration', { trigger: true })// => "Registration() called"

// here the Registration() action is not called
router.navigate('Registration')
// => 
Backbone.js applications state is managed by hashes (eg: #resource or #Registration). Everytime the hash changes an action is called inside the Backbone.Router. This is usefull but in some case you may need to change the hash by calling the router. You can achieve it by passing true to navigate() method:

Wednesday, 5 June 2013

check current express framework version


  • check current node js express framework version

npm info express version to fetch the latest version
 it's preferred that you do this instead of "3.x" below to prevent any future surprises.

package.json
{
  "name": "hello-world",
  "description": "hello world test app",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "express": "3.x"
  }
}