Category Archives: UI Js

Post related to jquery and extjs

grunt watch live reload file

gruntfile.js   module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON(“package.json”), jshint: { files: [“Gruntfile.js”, “src/*.js”], options: { globals: { jQuery: true, console: true, module: true } } }, concat: { options: { stripBanners: true, banner: “/*! <%= pkg.name %> – v<%= … Continue reading

Posted in UI Js | Leave a comment

back bone

Backbone.js   To declare User model :   App.Backbone.User = Backbone.Model.extend(); In above line i am assigning the Backbone model to App.Backbone.User variable . To declare User Collection :   we assign the model.   we bind the add and … Continue reading

Posted in UI Js | Leave a comment

javascript null undefined

You can just check if the variable has a truthy value or not. That means if( value ) { } will evaluate to true if value is not: null undefined NaN empty string (“”) 0 false The above list represents … Continue reading

Posted in UI Js | Tagged | Leave a comment

how to use boot strap css framework

Include these files . <link rel=”stylesheet” href=”http://twitter.github.com/bootstrap/assets/css/bootstrap-1.2.0.css”&gt; <link href=”http://twitter.github.com/bootstrap/assets/css/docs.css&#8221; rel=”stylesheet”> <link href=”http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css&#8221; rel=”stylesheet”> <script src=”http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js”></script&gt; Ref :      

Posted in HTML, UI Js | Leave a comment

How to use backbone.js

User : To declare User model : App.Backbone.User = Backbone.Model.extend();  To declare User Collection : we assign the model.  we bind the add and remove event to collection  To declare User Collection : App.Backbone.Users = Backbone.Collection.extend({ model : App.User, initialize: … Continue reading

Posted in UI Js | Leave a comment

Documentation of javascript code

docco or jsdoc Any Thoughts ?   Ref : http://code.google.com/p/jsdoc-toolkit/wiki/CookBook http://stackoverflow.com/questions/6438800/how-to-jsdoc-annotate-backbonejs-code http://jashkenas.github.com/docco/

Posted in UI Js | Leave a comment

Ajax file upload

First download fileuploader.js from above link  include in html.   <script type=”text/javascript” src=”js/fileuploader.js”></script> html : Write this in your html file. <div id=”content-uploader”>                 <noscript>                  <p>Please enable JavaScript to use file uploader.</p>               <!– or put a simple … Continue reading

Posted in UI Js | Leave a comment

implementing ineheritance in javascript and how inheritance is implemented in a language

understanding javascript with node.js   Ref : http://howtonode.org/object-graphs http://howtonode.org/object-graphs-2 http://howtonode.org/object-graphs-3

Posted in Node.js, UI Js | Leave a comment

how to check visibility of a div in jquery

if ($(‘#element_id:visible’).length > 0) console.log(‘the element is visible’); else console.log(‘the element is not visible’);   Ref : http://www.stoimen.com/blog/2009/07/08/jquery-check-for-element-visibility/

Posted in UI Js | Leave a comment

Making singleton class and sending event to the class in javascript

e.g. I want to send login event that other class will execute when he recieve that event so . For that I will send and on property with the send data like this :           request.on = {                 login: … Continue reading

Posted in OOP, UI Js | Leave a comment