Category: script

B

Basics of javascript Templating

Being the 100th post, i felt i should share some of my most useful learning here. And i could not think of anything better than javascript Templating. There are quite a handful of such templating tools available online(JsRender, Underscore.js, Moustache.js...). Feel free to run a jsPerf on the tool you wish to use and then ...

D

Detect multiple key press in javascript for your website

Many a times we end up in situations where in our clients are windows app migrants to web. And they could not let go off the "hotkey" concept. Let's say "Ctrl + S" or "Alt + R" to perform save or submit operation on a website. The options are endless. A scalable code that you ...

C

Combining Multiple attributes in jQuery

Below are some of the code snippets available in jQuery for you to combine your multiple lines of code: Combining multiple css properties or element attributes: Statement: Set the width and height attributes for a table with id=mytable $("#mytable").attr({width:'50px',height:'40px'}); Statement: Set the css properties of width, height, background-color for a div with id=mydiv $("#mydiv").css({width:'50px',height:'40px',background-color:'#F2F2F2'}); Combining ...

S

SharePoint Client Object Model (ECMAScript) #2 – Update Web Properties

SharePoint Client Object Model (ECMAScript) provides the capabilities of SharePoint Server Object capabilities at the client side. In this tutorial, let me show you how you can play around with the Client Object Model through IE Developer Toolbar how to update Web properties. Check the screenshot below, to know what we are trying to achieve ...

S

SharePoint Client Object Model (ECMAScript) #1 – Get Context Object

SharePoint Client Object Model (ECMAScript) provides the capabilities of SharePoint Server Object capabilities at the client side. In this tutorial, let me show you how you can play around with the Client Object Model through IE Developer Toolbar. Check the screenshot below, to know what we are trying to achieve here: Below is the function ...

B

Best Practices for jQuery Developers

Following are some of the best practices that you could follow while working with jQuery: Plugins: Please avoid unnecessary use of plugins If a plugin is being used, respect the authors work and ensure that the plugin file is reused with the license comments intact If you are writing a reusable functionality in the code, ...

D

Dialogs in SharePoint 2010 – Part 1

Most of us SharePoint developers when posed with a question of showing content in a popup, we tend to make use of window.open() and window.showModalDialog(). Many of us forget about the fact that SharePoint 2010 itself has modal dialog to perform this operation. In this part we will see how to setup a modal popup ...

S

SharePoint Re-Deployment Bat File

A simple bat file that you can use for redeploying your WSPs: Copy the following text in a notepad and Save As 'Deployment.bat' stsadm -o retractsolution -name "ProjectA.Deployment.wsp" -immediate -url "http://localhost:2000/" stsadm -o execadmsvcjobs stsadm -o deletesolution -name "ProjectA.Deployment.wsp" stsadm -o addsolution -filename "D:\ProjectA.Deployment.wsp" stsadm -o deploysolution -name "ProjectA.Deployment.wsp" -immediate -allowgacdeployment -url "http://localhost:2000/" -force stsadm ...

E

Enable Tab navigation for your entire page using jQuery

One of the most commonly faced Accessibility issue is in maintaining the tab order. If you don't take it the right way, you might end up wasting days and days of effort, when you can just get it done in 2mins using jQuery. Requirement: Clicking on tab should go through all the functional controls on ...

j

jQuery Plugin: Page Size Analyzer for Page Performance Monitoring

One of my senior Technical Architect asked me if i could come up with some useful widget that could help him display the page size of the current page. I thought of writing a jQuery plugin that could do this job. I am sharing it here. Do read the notes carefully before using it. Screenshot: ...