Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

11 August, 2012

Create a favicon for your website

It is one of the short cut icon for an website or web page.The format for this icon is .ico. Normally 16x16 pixel icon is associated with a particular web site or web page.Other than .ico format it can support few other formats like .png,.gif. But it may not support all browser. So, .ico format is compatiable to every popular browser.Few other sizes can be used like 16×16, 32×32, 48×48, or 64×64 but , it depends on browser .

You can generate the favicon icon online also. Go for google search you can find some suggestion for creating favicon.

Example : -

http://www.favicon.cc/


Its simple. You just need a link tag on your page. Just put this tag under <HEAD></HEAD> tag of your Page. The tag like :-

<link rel="shortcut icon" href="path/location of your favicon" type="image/x-icon" /> 


Read more from wiki



18 May, 2012

HTML/JAVASCRIPT: Creating a window in Javascript

Some times its an useful job to create a window with a new requirement. But , when we are in development room/area , we always remember any search engine to fine the solutions for any type of problem. Even I , also  following some of the search engine. 

But, it is a fact that I am always try to avoid this type of habits. Be , traceable  for finding any solution. This article is one of the mail memory & also my teaching my myself , that don't guess any coding is normal and easy , so don't remember.


So, below the topic:- code line put inside script tag


window.open('','','left=0,top=0,width=1000,height=780,toolbar=0,scrollbars=0,status=0');orwondow.open();

All parameters are not mandatory  to put with values. If you don't need any scrollbar,toolbar,status bar then you can put 0 as the value here, either put 1. 

17 May, 2012

How to set print area in JSP/HTML page for printer

This is one the interesting topic related to print the specific data from a jsp/html page. Directly to printer, without other browser data. I have done a quite obvious way in javascript for set the print area for printing. I faced this problem in my development team with me, for set a specific area for print.

Caution:-  Use of JavaScript may not be  always acceptable, due to client. If user/client disable the script setting in browser these may not work properly. But, every browsers are support script by default.  

As we know, window. Print() is used for print in JavaScript. There are so many ways to do a printing task in jsp/html page. Out of all I have mentioned 2 process below with advantage & disadvantage.  Put the below function in script area of your page:-

Procedure-1
function setDivPrint(val){
var printdata=document.getElementById('printarea').innerHTML;
var srcOriginalContent=document.body.innerHTML;
document.body.innerHTML=printdata;
window.print();
document.body.innerHTML=srcOrigionalContent;
}
Here ‘printarea ‘ is the id of printable div. It has some limitation, with getting the cancel button click event and some more. I am not mentioning all here. But in procedure-2 is so eminent than procedure-1.

Procedure-2

function setDivPrint(val){
var printdata=document.getElementById('printarea').innerHTML;
var printwindow=window.open('','','left=0,top=0,width=1000,height=780,toolbar=0,scrollbars=0,status=0');
printwindow.document.write(printdata);
printwindow.document.close();
printwindow.focus();
printwindow.print();
printwindow.close();
}

Here ‘printarea ‘ is the id of printable div. .This method is recommended to use. In this method no need to get the cancel or print button event. Suppose the user click on cancel, then the main original page should come, but it may not coming with the Procedure-1 . So, No need to face this problem in Procedure-2.

25 April, 2012

Manoj.Blog: HTML Marquee : set Stop and Play on mouse over an...

Manoj.Blog: HTML Marquee : set Stop and Play on mouse over an...: Hello readers, As you  marquee  can create a scrolling preview. But when we need to make some operation like mouse over ,mouse out etc. S...

HTML Marquee : set Stop and Play on mouse over and mouse out

Hello readers,

As you  marquee  can create a scrolling preview. But when we need to make some operation like mouse over ,mouse out etc. Stop & play of marque like below:-


<marquee  onmouseover="this.setAttribute('scrollamount',0,0);" onmouseout="this.setAttribute('scrollamount',6,0);">
<a  style="color: #FF0000" href="#" title="Notice">New notice for Marquee readers</a>
</marquee>


This above code will help you for stop and play on mouse over and mouse out respectively.


Hope it will help you.
Thankx

08 April, 2012

Manoj.Blog: Javascript : Password Validation with Regular expr...

Manoj.Blog: Javascript : Password Validation with Regular expr...: Hi viewers, This topic - Password Validation with Regular expression. Its a daily process for web developers to validating the passwo...

How to validate Password with Regular expression.

In Today article,  we will see how to validate password with Regular expressionIts a daily process for web developers to validating the password with certain rules.With java script client side validate can be achieved. Below the code will help you to validate the password which contain at least one Letter , one Number & one special character. The password length must be within a given range.



/* Password must be at least one char, one special char & one digit & the length must be given*/
function validatePassword(pwdelem,alertmsg){
    var password_expression=/^((?=.*[a-zA-Z])(?=.*\d)(?=.*[#@%$]).{6,20})$/;
    if(pwdelem.value.match(password_expression)){
        return true;
    }
    else{
        alert(alertmsg);
        pwdelem.focus(); //Set focus to the given source element id ( textbox or password) ,it is optional .
        return false;
    }
}



30 December, 2011

FACEBOOK Link Integration to your Website

Copy the below given code inside your Html Page <Body> Tag and enjoy the facebook share plugin.

<a name="fb_share" type="button"  share_url="Your Website URL">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
        type="text/javascript">
</script>




Happy Learning. 

09 September, 2011

Manoj.Blog: Java Script : Drop Down values in JAVA SCRIPT

Manoj.Blog: Java Script : Drop Down values in JAVA SCRIPT: Hello , This function will help you to find the combo box / drop down box values in java script and again set these values to FORM. functio...

Java Script : Drop Down values in JAVA SCRIPT

Hello , This function will help you to find the combo box / drop down box values in java script and again set these values to FORM.

function setVal()
{
alert("sdf");
var innerData=document.getElementById('totData').innerHTML;
var hdtit=document.getElementById('hdsubtit').value;
var hdvalue=document.getElementById('hdsubval').value;
alert(hdtit);
//Getting Selected Index
var v=document.frmSubject.ddsub.selectedIndex;
//Getting Text & Value
var textdata=document.frmSubject.ddsub.options[v].text;
var val=document.frmSubject.ddsub.options[v].value;
//set the value to Form hidden Field
document.frmSubject.hdsubtit.value=hdtit+","+textdata;
document.frmSubject.hdsubval.value=hdvalue+","+val;
if(hdvalue==0){
document.getElementById('totData').innerHTML=innerData+" "+textdata;
}else{
document.getElementById('totData').innerHTML=innerData+" "+textdata;
}
}




Any Quries ....?

You may contact.

12 August, 2011

HTML:- Get Browser Closed Event

Getting the browser closed event ,before close we can get the event and do something.I need this This is needed when needed to set the session null or the session should be destoryed after closed the browser.By this we can achive that...........







script type="text/javascript"

function closeEditorWarning()

{

return 'Hey, What r u Doing ? Are you sure?'

}

window.onbeforeunload = closeEditorWarning;