Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Monday, March 5, 2012

Javascript For Pop-Up Facebook Fan Page

Step 1: Get a username for your facebook fan page. Go to http://www.facebook.com/username for creating a username for your facebook fan page

Step 2:Download The FileScript

Step 3: Open it in notepad

Step 4: Find out HiphopXz and replace it with your facebook fan page username

Step 5: Now Go to Blogger-->Javascript/HTML-->Paste The code-->Click on Save

Step 6: Done

Javascript For Pop-Up Facebook Fan Page


Thursday, August 18, 2011

Javascript for Different Type of Alert Message

An alert box is box that appears on the display screen to give you information. Alert box can be created in various way. Here, i have put a common alert box with OK Button in JavaScript. Just change the phrase according to your need. Sometimes your site may be contain explicit contents. It is useful if you notify your readers before they enter in those contents. This java script is described in no.2 script. Here,you can redirect your readers to other site or location if they do not want enter your site.Here, i put yahoomail as another URL to redirect my visitors.

1. JavaScript with  OK Button

<script type="text/javascript">
alert('You are about to enter an extremely funny site. People who are prone to laughing fits ... Beware!')
</script>
<noscript>Enable javascript in your browser to view an important message.</noscript> 



2. JavaScript with  Confirmation Button  

<script type="text/javascript">
confirm('This site contains explicit contents. Are you sure you want to continue?');
if (confirm('This site contains explicit contents. Are you sure you want to continue?')) {
window.location = "http://lucky-techblog.blogspot.com/";
}
else {
window.location = "http://www.yahoomail.com/";
}
</script> 


 

Wednesday, August 3, 2011

JavaScript for Disabling Right Mouse Click

This is a java script code which will disable right click on blogger post body. This trick can be done by putting the mentioned javascript before head end tag of blogger template or any particular post of the blogger. It is sometimes annoying if someone copies your blog posts,articles,images and another kind of information owned by you saying that they are the original owners of the content.In this case, you can use this trick to block copying of a particular post of yours.



Copy this script and paste it anywhere in blogger post body to disable right click.


<script language='JavaScript1.2'>



//Disable select-text script (IE4+, NS6+)- By Andy Scott

//Exclusive permission granted to Dynamic Drive to feature script

//Visit http://www.dynamicdrive.com for this script



function disableselect(e){

return false

}



function reEnable(){

return true

}



//if IE4+

document.onselectstart=new Function ("return false")



//if NS6

if (window.sidebar){

document.onmousedown=disableselect

document.onclick=reEnable

}

</script>

<script language='JavaScript'>curPage=1;

document.oncontextmenu = function(){return false}

if(document.layers) {

window.captureEvents(Event.MOUSEDOWN);

window.onmousedown = function(e){

if(e.target==document)return false;

}

}

else {

document.onmousedown = function(){return false}

}</script>