Research and Development work on PHP, MYSQ,JQuery,Angular Js,React Native,Laravel,Wordpress,Magento,Joomla
Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts
Wednesday, October 9, 2013
Wednesday, August 14, 2013
Wednesday, July 10, 2013
Thursday, May 23, 2013
Monday, April 29, 2013
How to Print a part of webpage using Javascript
<div dir="ltr" style="text-align: left;" trbidi="on">
<script type="text/javascript">
function printDiv()
{
var divToPrint=document.getEelementById('areaToPrint');
newWin= window.open("");
newWin.document.write(divToPrint.outerHTML);
newWin.print();
newWin.close();
}
</script>
<div id="areaToPrint">
The text you want to print or the content you want to print
</div>
</div>
How to add a Bookmark to the Browser using Javascript
<div dir="ltr" style="text-align: left;" trbidi="on">
<script type="text/javascript">
function Add_Bookmark_Favorite(url,title)
{
if (window.sidebar)
{ // Mozilla Firefox Bookmark
//Make sure "Load this bookmark in the sidebar is deselected
window.sidebar.addPanel(title, url,"");
return false;
}
else if( window.external )
{ // IE Favorites
window.external.AddFavorite( url, title);
return false;
}
else if(window.opera && window.print)
{ // Opera Bookmark
return !addToFav(url,title)
}
}
</script>
<a href="" onclick="Add_Bookmark_Favorite('http://www.google.com/','Google')">Bookmark this link</a>
</div>
Wednesday, November 21, 2012
Javascript – get Url
window.location.href - get entire url
window.location.protocol - get protocol: "http" / "https"
window.location.host - get hostname, e.g: "www.g31zone.com"
window.location.pathname - get script name, e.g: "example/index.html"
Subscribe to:
Posts (Atom)