What's up!

Pyaarey Allah!
Showing posts with label Javascript - JQuery. Show all posts
Showing posts with label Javascript - JQuery. Show all posts

Sunday, September 1, 2013

Include jqeury bookmarklet

0 comments




    (function() {
      var el=document.createElement('div'),
          b=document.getElementsByTagName('body')[0],
          otherlib=false,
          msg='';
      el.style.position='fixed';
      el.style.height='32px';
      el.style.width='220px';
      el.style.marginLeft='-110px';
      el.style.top='0';
      el.style.left='50%';
      el.style.padding='5px 10px';
      el.style.zIndex = 1001;
      el.style.fontSize='12px';
      el.style.color='#222';
      el.style.backgroundColor='#f99';
     
      if(typeof jQuery!='undefined') {
        msg='This page already using jQuery v'+jQuery.fn.jquery;
        return showMsg();
      } else if (typeof $=='function') {
        otherlib=true;
      }
     
      // more or less stolen form jquery core and adapted by paul irish
      function getScript(url,success){
        var script=document.createElement('script');
        script.src=url;
        var head=document.getElementsByTagName('head')[0],
            done=false;
        // Attach handlers for all browsers
        script.onload=script.onreadystatechange = function(){
          if ( !done && (!this.readyState
               || this.readyState == 'loaded'
               || this.readyState == 'complete') ) {
            done=true;
            success();
            script.onload = script.onreadystatechange = null;
            head.removeChild(script);
          }
        };
        head.appendChild(script);
      }
      getScript('http://code.jquery.com/jquery.min.js',function() {
        if (typeof jQuery=='undefined') {
          msg='Sorry, but jQuery wasn\'t able to load';
        } else {
          msg='This page is now jQuerified with v' + jQuery.fn.jquery;
          if (otherlib) {msg+=' and noConflict(). Use $jq(), not $().';}
        }
        return showMsg();
      });
      function showMsg() {
        el.innerHTML=msg;
        b.appendChild(el);
        window.setTimeout(function() {
          if (typeof jQuery=='undefined') {
            b.removeChild(el);
          } else {
            jQuery(el).fadeOut('slow',function() {
              jQuery(this).remove();
            });
            if (otherlib) {
              $jq=jQuery.noConflict();
            }
          }
        } ,2500);
      }
    })();



Tuesday, March 6, 2012

My favorite shortcut key combinations

0 comments


All mapped with ALT key :P


1 - Compile Current Project


2 - Start outlining
3 - Toggle outline on current block
4 - Toggle all blocks


5 - Comment selection
6 - Uncomment selection


7 - Find in files
8 - Repalce in files


9 - Insert Snippet


0 - Attach to process
= - Attach to Current IIS process(VS Commands customized shortcut)


Q - Format selection
W - Full document format


Z - Zen expand (with zen coding VS plugin)
X - Zen Wrap (with zen coding VS plugin)


Space - save all items

A - Close currently selected window
S - Close all but currently selected window

Friday, July 15, 2011

Thursday, May 26, 2011

Fix firefox localhost slow connections/browsing/rendering

0 comments

  1. Open ff and write this command in address base " about:config "
  2. Tell firefox that you will be helpful while editing configuration
  3. in the FilterBox type " v6 "
  4. double click on the entry network.dns.disableIPv6 so it should be be " TRUE " now.
  5. You are done, rock on!

Saturday, January 29, 2011

Development Updates Power post

0 comments

I will include ASP.NET MVC3 stuff and then I will also add some misc stuff which I think you should be aware of along-with the news of MVC3.

MVC3 Code Samples From MSDN
 MVC 3 with Razor
 MVC 3 Filters
 MVC 3 Remote Client Validation
Getting Started with MVC C# 3
Getting Started with MVC 3 VB

Some important stuff from Scott Gu's Blog
ASP.NET MVC 3: Layouts and Sections with Razor 


IIS/ASP.NET Application Hosting and Management
------------------------------------------------------------
Auto-Start ASp.NET Applications
http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx

Common performance issues on ASP.NET web sites
http://blogs.msdn.com/b/mcsuksoldev/archive/2011/01/19/common-performance-issues-on-asp-net-web-sites.aspx

Microsoft Web Farm Framework
-------------------------------------
Introducing the Microsoft Web Farm Framework
http://weblogs.asp.net/scottgu/archive/2010/09/08/introducing-the-microsoft-web-farm-framework.aspx

Microsoft Web Farm Framework 2.0
http://weblogs.asp.net/scottgu/archive/2011/01/20/microsoft-web-farm-framework-2-0.aspx

IIS.net Official Complete Guide to Web Farm Framework 2.0
http://learn.iis.net/page.aspx/905/microsoft-web-farm-framework-20-for-iis-7/



C#
----
Optional Parameters and Named Arguments in C# 4 (and a cool scenario w/ ASP.NET MVC 2)
http://weblogs.asp.net/scottgu/archive/2010/04/02/optional-parameters-and-named-arguments-in-c-4-and-a-cool-scenario-w-asp-net-mvc-2.aspx

Nuget
-------
Adding packages to nuget.org
http://codingreflection.com/2011/01/26/adding-packages-to-nuget-org/


CSS3
------
CSS Agent(automatic vendor prefixes,constants,Minification)
http://www.keithclark.co.uk/labs/cssagent/

VSTS2010
-----------
Box Selection and Multi-Line Editing with VS 2010
http://weblogs.asp.net/scottgu/archive/2010/04/26/box-selection-and-multi-line-editing-with-vs-2010.aspx

VS 2010 Productivity Power Tools Update (with some cool new features)
http://weblogs.asp.net/scottgu/archive/2010/07/19/vs-2010-productivity-power-tools-update-with-some-cool-new-features.aspx

Fun Visual Studio 2010 Wallpapers
http://weblogs.asp.net/scottgu/archive/2010/05/12/fun-visual-studio-2010-wallpapers.aspx

Download and Share Visual Studio Color Schemes
http://weblogs.asp.net/scottgu/archive/2010/04/29/download-and-share-visual-studio-color-schemes.aspx

Visual Studio 2010 Keyboard Shortcuts
http://weblogs.asp.net/scottgu/archive/2010/07/29/visual-studio-2010-keyboard-shortcuts.aspx

Javascript Code Snippets in Visual Studio
http://weblogs.asp.net/scottgu/archive/2009/09/04/asp-net-html-javascript-snippet-support-vs-2010-and-net-4-0-series.aspx

Searching and Navigating Code in VS 2010 (VS 2010 and .NET 4.0 Series)
http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx

Add Reference Dialog Improvements (VS 2010 and .NET 4.0 Series)
http://weblogs.asp.net/scottgu/archive/2009/10/29/add-reference-dialog-improvements-vs-2010-and-net-4-0-series.aspx

VS 2010 SP1 (Beta) and IIS Express
http://weblogs.asp.net/scottgu/archive/2011/01/03/vs-2010-sp1-beta-and-iis-developer-express.aspx

HTML5 & CSS3 in Visual Studio 2010 SP1
http://blogs.msdn.com/b/webdevtools/archive/2011/01/27/html5-amp-css3-in-visual-studio-2010-sp1.aspx

Database Deployment with the VS 2010 Package/Publish Database Tool
http://rachelappel.com/deployment/database-deployment-with-the-vs-2010-package-publish-database-tool/

ASP.NET MVC2
-----------------
ASP.NET MVC 2: Strongly Typed Html Helpers
http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx

ASP.NET MVC 2: Model Validation
http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx

ASP.NET MVC3
-----------------
MSDN Official Guide ASP.NET MVC3
http://msdn.microsoft.com/en-us/library/gg416514%28v=vs.98%29.aspx

Introducing ASP.NET MVC 3 (Preview 1)
http://weblogs.asp.net/scottgu/archive/2010/07/27/introducing-asp-net-mvc-3-preview-1.aspx

Announcing NuPack, ASP.NET MVC 3 Beta, and WebMatrix Beta 2
http://weblogs.asp.net/scottgu/archive/2010/10/06/announcing-nupack-asp-net-mvc-3-beta-and-webmatrix-beta-2.aspx

Announcing the ASP.NET MVC 3 Release Candidate
http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx

Announcing ASP.NET MVC 3 (Release Candidate 2)
http://weblogs.asp.net/scottgu/archive/2010/12/10/announcing-asp-net-mvc-3-release-candidate-2.aspx

ASP.NET MVC 3: New @model keyword in Razor
http://weblogs.asp.net/scottgu/archive/2010/10/19/asp-net-mvc-3-new-model-directive-support-in-razor.aspx

ASP.NET MVC 3: Server-Side Comments with Razor
http://weblogs.asp.net/scottgu/archive/2010/11/12/asp-net-mvc-3-server-side-comments-with-razor.aspx
http://weblogs.asp.net/scottgu/archive/2011/01/13/announcing-release-of-asp-net-mvc-3-iis-express-sql-ce-4-web-farm-framework-orchard-webmatrix.aspx

Running an ASP.NET MVC 3 app on a web server that doesn’t have ASP.NET MVC 3 installed
http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx

Partial Page Output Caching in ASP.NET MVC 3 - OutputCache Attribute
http://davidhayden.com/blog/dave/archive/2011/01/25/PartialPageOutputCachingASPNETMVC3.aspx

Dependency Injection with ASP MVC 3–Distilled and Simplified
http://www.lostechies.com/blogs/johnvpetersen/archive/2011/01/23/dependency-injection-with-asp-mvc-3-distilled-and-simplified.aspx

Dependency Injection in MVC 3–with Views
http://www.lostechies.com/blogs/johnvpetersen/archive/2011/01/24/dependency-injection-in-mvc-3-with-views.aspx

ASP.NET Razor Converter(ASPX TO Razor templates)
https://github.com/telerik/razor-converter

How To: Add Mobile Pages to Your ASP.NET Web Forms / MVC Application
http://www.asp.net/learn/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application

ViewBag in ASP.NET MVC 3
http://davidhayden.com/blog/dave/archive/2011/01/19/ViewBagAspNetMvc3.aspx

ASP.NET MVC 3–What’s in it for you?
http://weblogs.asp.net/jgalloway/archive/2011/01/18/asp-net-mvc-3-what-s-in-it-for-you.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+jongalloway+%28Jon+Galloway%29&utm_content=Twitter

Configurable Global Action Filters for ASP.NET MVC
http://odetocode.com/Blogs/scott/archive/2011/01/15/configurable-global-action-filters-for-asp-net-mvc.aspx

A Comparison of Three jQuery Modal Dialogs for ASP.NET MVC
http://www.codeproject.com/KB/ajax/jQuery-Modal-Dialogs.aspx

Jquery
--------
Microsoft's  stephen walther's Proposal of Jquery templates on the jquery forum
http://forum.jquery.com/topic/jquery-templates-proposal

jQuery Templates and Data Linking (and Microsoft contributing to jQuery)
http://weblogs.asp.net/scottgu/archive/2010/05/07/jquery-templates-and-data-linking-and-microsoft-contributing-to-jquery.aspx

T4 Templates
----------------
T4 Templates and the Entity Framework
http://msdn.microsoft.com/en-us/gg558520

Monday, December 27, 2010

Jquery Live Method And Event Bubbling

1 comments

Take a look at the following code


[script type="text/javascript"]
                //parent clicked, return false
                $('.level1').live('click', function () {
                                return false;
                });

                //child clicked, alert
                $('.level2').live('click', function () {
                                alert('level2 clicked');
                });
[/script]

[div class="level1"]
[div class="level2"]Clicking on my will not alert[/div]
[/div]

In Jquery Live-events-binding, the event from level2(child) element will be passed on to level1(parent), then to parent's parent and finally to the root of the DOM(document object). If on any level the event it being canceled/interrupted by a parent then the child element's event will not be triggered. For example in the given code when we will click on the level2 element, the alert box will not show because the level1 div is blocking it by returning a false. This is the way things work in Jquery Live-events-binding. So be careful while using Live Events which can behave unexpected due to a little logical mistake.

Best Open Source Javascript Editor

0 comments

I found Komodo Editor by a youtube video reference and it was a GREAT edition to my Javascript Editors :P Too many editors. Unlike Visual Web Developer you can

  •  Fold the code, not only function blocks but also every curly brace block which is extremely cool
  • Click beside the starting bracket it will select the ending one, bravo.
  • The Dark theme is cool, I have started liking working with black background.
  • You can open not only files but also projects.
  • You associate file extensions with appropriate programming language. By default aspx is not associated, I bound with HTML view. I could have used XML too. The code folding works on that file too. Even that is server side code. For that go to Edit > Preferences > File Associations.
  • You can customize the colorization experience by Edit > Preferences > Fonts and colors. 
  • On the top toolbox you can "Show/Hide left pane" etc so you can view project browser on demand.
  • The vertical lines to show matching braces is a cool feature.
  • Guess what ! GO TO DEFINITION in javascript? ;) 
  • Code intellisense is also there. Liked it. It remembers variable names, function names and shows common objects such as window and document and their functions like alert() and parseInt() etc. 
I din't expect this much of features from a non-MS editor specially this level of javascript support which is leaving Microsoft Visual Web Developer behind many years.
    Click here to vist Komodo's Official website

    Firebug - Check DOM Event Bindings

    0 comments

    Go to Firebug Console edito and run this command

    $('#mybutton').events('data')
    See in the console logger  It will show the events bound with the mybutton element just like
    object {click=}
    You can further click on that link to see the Handler Node, Note that hovering the mouse over the word function(written next to Handler) will show a tooltip telling file name and line number. Click the word function to go to the line of code in script tab.

    Saturday, December 25, 2010

    Alternate Images in 'img' tags in Html

    0 comments

    I found a cool solution:


    Click here...