JQuery Hide Method With Example.

Here we are going to have a look for JQuery hide(). This method is useful for hiding the HTML elements on the webpage.
In the below written code we can see how to hide the paragraph on anchor tag click. Continue reading JQuery Hide Method With Example.

Advertisements

Auto Refresh Web Page In WebApplication

In this post we will have a look for how to refresh web page? There are following ways to reload your web page after some interval of time (Eg:- in 10 seconds).
You can simply add following line of code in between <head> … </head> section to enable auto refresh in an Asp.Net web page or a HTML page.

 <meta http-equiv="refresh" content="15"/>  

You can also add follwoing line of code in between <head> … </head>┬ásection to redirect to a specific page if you put the URL inside the tag.

 <meta http-equiv="refresh" content="5;url=http://www.google.com" />  

If you want to set the refresh web page dynamically then that can be done in Asp.Net by adding server side code in the Page_Load function to set it, as shown below:

 Response.AppendHeader("Refresh", "15");  

Add Span Tag To Hyperlink

To add span tag to hyperlink we need use prepend property in jQuery. Code is as below :

 <html>  
 <head>  
 <title>Add span tag inside of href</title>  
 <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>  
 <script type="text/javascript">  
 $(function () {  
 $('#htitle').text('');  
 $('#htitle').prepend(" <span class=testinghref >Example for adding span </span> tag to href through jquery");  
 })  
 </script>  
 <style type="text/css">  
 .testinghref {  
 background: grey;  
 font-family:arial;  
 font-weight:bold;  
 }  
 </style>  
 </head>  
 <body>  
 <a href="#" id="htitle"></a>  
 </body>  
 </html>