11:04 PM

Refresh a page


Page refresh

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-2.1.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            setTimeout(function () {
                window.location.reload();
            }, 60 * 1 * 1000);
           
            //Page refresh after 40 min -
            //Example :- 60 * 40 * 1000
            //Format:-  60 * (minute) * 1000
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
[.....]

9:43 PM

jQuery remove tag from HTML-String


remove only html tags in a string 
var s = '<span>javascript</span> programming language';  var r = /<(\w+)[^>]*>.*<\/\1>/gi; alert(s.replace(r,"")) [.....]

2:59 AM

jQuery Intellisense in Visual Studio 2010

Step 1:  Go to http://jquery.com/download/
Step 2:  Click the "Microsoft CDN"
Step 3:  Accrording to download your versinon like jquery version 1.10.0
Step 4:  Download the vsdoc file (jquery-1.10.0-vsdoc.js).
Step 5:  The -vsdoc.js or .debug.js file must be located in the same folder as the javascript library

Or you can download

http://archive.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736

[.....]

4:36 AM

Focus on DIV

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(
            function () {
                $('html, body').animate({ scrollTop: ($("#DivContent2").offset().top - 100) }, 'slow');
            });

        function clickwithbtn()
        {
            $('html, body').animate({ scrollTop: ($("#DivContent2").offset().top - 100) }, 'slow');
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div><input type="button" value="Click" onclick="clickwithbtn()" id="btnClick" /> </div>
      <div id="DivContent1" [.....]

4:20 AM

Deserialize JSON string to c# object


List of serializers


XmlSerializer: The XmlSerializer enables you to control how objects are encoded into XML.
JavaScriptSerializer:  Provides serialization and deserialization functionality for AJAX-enabled applications.
DataContractSerializer: DataContractSerializer class to serialize and deserialize instances of a type into an XML stream or document.
NetDataContractSerializer: NetDataContractSerializer can be used only if both the serializing and deserializing ends share the same CLR types.
DataContractJsonSerializer:  Serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects.


string strjson= "{\"Age\":\"32\",\"Exp\":\"6 Years\",\"Name\":\"Tarun\",\"Technology\":\".NET\"}";
JavaScriptSerializer serializer1 = new JavaScriptSerializer();
object obje = serializer1.Deserialize<object>(strjson); [.....]

6:31 AM

How to remove specifc value from array using jQuery

Step1: Create an array
Step2: Use the grep() method of jQuery, which takes  parameters.
            First parameter is array.


var x = [9, 10, 11,12,13,14,15]
var removeData = 12;

x = jQuery.grep(x, function(value) {
 return value != removeData;
     });

-----------------------------
Output:-
[9, 10, 11,13,14,15] [.....]

9:11 AM

Reading XML string into datatable


string str= "<NewDataSet> <Table1> <ID>1</ID> <Name>Tarun</Name> <Alias /> <Alias2 /> <Action>Add</Action> </Table1> <Table1> <ID>2</ID> <Name>Rahul</Name> <Alias /> <Alias2 /> <Action>Add</Action></Table1></NewDataSet>"


DataSet ds = new DataSet(); ds.ReadXml(new StringReader(str)); DataTable table1 = ds.Tables["Table1"]; [.....]

9:02 AM

Uncheck radio buttons using jQuery general selectors

$('form[id^="form1"]').find("input:radio:checked").prop('checked',false); [.....]

8:55 AM

Change form input value with Jquery

$('input[class="booknow"]').val("Change Submit");
<input type='text' class="booknow" value="BOOK" name='project'>option</input>
[.....]

1:52 AM

placeHolder with jQuery

Hi frined,


http://sarveshmcasoft.blogspot.in/p/blog-page.html

[.....]

Next PostNewer Posts Previous PostOlder Posts Home