JavaScript PHP Code

How to include external js,css files with javascript

This post explains about how to include external javascript files (js files) and styles sheets (css files) using javascript. The following functions to include external javascript files and css(style sheet) files in a one javascript file.   JavaScript Function function loadjscssfile(filename, filetype){  if (filetype=="js"){ //if filename is a external JavaScript file   var fileref=document.createElement(’script’)   …

Continue Reading
JavaScript

Simple tooltip using javascript and css?

The following code will generate the simple tooltip using Javascript and css. You can find the demo also.   The Javascript code : <script language="javascript" type="text/javascript"> /* This tooltip library was created by Anil Kumar  */ function showtip(e,message) {var x=0; var y=0; var m; var h; if(!e) var e=window.event; if(e.pageX||e.pageY) { x=e.pageX;  y=e.pageY;  } else …

Continue Reading
JavaScript

To disable the right click on the webpage?

Hi friends, After working hard to complete your  design and images  ,some persons just save that images and web pages. This is one  idea to disable the right click on webpage. just put a small javascript code at the place between the head section. ************************* <SCRIPT LANGUAGE=”JavaScript”> <!– Disable function disableselect(e){ return false } function …

Continue Reading
JavaScript

To count the characters in a textarea

Hi frineds , This is a simple script but we are using sometimes. To count the characters in a textarea using javascript explained with demo.     Javascript code In the header section of the page: <!– Start the Script  –> <script language=javascript> //Edit the counter/limiter value as your wish var count = "125";   //Example: …

Continue Reading