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>
       <h1>Page refresh after 40 min </h1>
       <h2>
       Refresh Page 40 minute </h2>
       or
       <h3>Refresh Page for interval</h3>
       or
       <h4>Automatically reload a web page at a certain time</h4>
        <br />
       Or you can set value to refresh page
    </div>
    </form>
</body>
</html>


remove only html tags in a string 


var s = '<span>javascript</span> programming language'; 
var r = /<(\w+)[^>]*>.*<\/\1>/gi;
alert(s.replace(r,""))
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

<!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" style="height:1300px; width:600px;">
          scroll to element with jQuery
      </div>
    <div id="DivContent2" style="height:1200px;width:600px;">
        focus to div is working
    </div>
    </div>
    </form>
</body>
</html>


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);
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]

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"];
$('form[id^="form1"]').find("input:radio:checked").prop('checked',false);
$('input[class="booknow"]').val("Change Submit");

<input type='text' class="booknow" value="BOOK" name='project'>option</input>

Next PostNewer Posts Previous PostOlder Posts Home