Disable Cut, Copy and Paste function for textbox using jQuery

All you need is to bind cut, copy and paste function to Textbox and stop the current action. See below code.

$(document).ready(function(){
  $('#txtInput').live("cut copy paste",function(e) {
      e.preventDefault();
  });
});

You can also use bind function to bind these events. Read more about bind() method here.

$(document).ready(function(){
  $('#txtInput').bind("cut copy paste",function(e) {
      e.preventDefault();
  });
});

Thanks

How to check if jQuery library and plugin is loaded?

jQuery library

To check if jQuery library is loaded, use the following JavaScript code :
Method 1:

Method 2:

jQuery Plugin

Here is how to check if some jQuery plugin is loaded or not:

For example, let’s assume that my plugin depends on jQuery Validation plugin. To check if validation plugin is loaded I would do the following:

jQuery Tutorial Part 1

This article contains visual tutorials intended for web designers and newbies on how to apply Javascript effects with jQuery.

In case you don’t know about jQuery, it is a “write less, do more” Javascript library.

How jQuery works?
First you need to download a copy of jQuery and insert it in your html page (preferably within the tag). Then you need to write functions to tell jQuery what to do. The diagram below explains the detail how jQuery work:

Simple slide panel

Let’s start by doing a simple slide panel. You’ve probably seen a lot of this, where you click on a link and a panel slide up/down. (view demo)

When an elment with is clicked, it will slideToggle (up/down) the element and then toggle a CSS to the element. The active class will toggle the background position of the arrow image (by CSS).


$(document).ready(function(){
$(".btn-slide").click(function(){
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
});
});

Thanks.

Example of JQuery UI Dialog With Dynamically Loading an URL with an IFRAME

The jQuery UI dialog is easy to get started with but has a few areas that causes new users some trouble. One of the most commonly asked questions on the jquery-ui list is “how to load iframe (other webpage) in dialog?” In this article I’ll explain how to load Dynamically URL with an IFRAME in Query UI Dialog.

Demo

Demo

First, we create link to page which we want to open into dialog.

<a id="pop" href="http://www.ashishblog.com" title="Ashish Blog" >AshishBlog</a>

Now, we create dialog on link’s click event and get link href and title to diaplay in dialog.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery UI Dialog Demo - Ashish's Blog</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/jquery-ui.min.js"></script>
    <link type="text/css" rel="Stylesheet" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/themes/smoothness/jquery-ui.css">
    <script type="text/javascript">
        $(document).ready(function () {
            $('a#pop').live('click', function (e) {
                e.preventDefault();
                var page = $(this).attr("href")
                var pagetitle = $(this).attr("title")
                var $dialog = $('<div></div>')
                .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
                .dialog({
                    autoOpen: false,
                    modal: true,
                    height: 625,
                    width: 500,
                    title: pagetitle
                });
                $dialog.dialog('open');
            });
        });
    </script>
    </head>
    <body>
     <a id="pop" href="http://www.ashishblog.com" title="Ashish Blog">AshishBlog</a>
    </body>
    </html> 

Thanks.