Tuesday 25 August 2015

Javascript Object oriented Main Concepts

Javascript Object oriented Main Concepts

Create Global Namespace


var Myns= Myns|| {};
 
 
MYAPP.commonMethod = {
  regExForName: "", 
  regExForPhone: "", 
  validateName: function(name){
    
    
  },
 
  validatePhoneNo: function(phoneNo){
    // do with number
  }
}

// Object together with the method declarations
MYAPP.event = {
    addListener: function(el, type, fn) {
    // code stuff
    },
    removeListener: function(el, type, fn) {
    // code stuff
    },
    getEvent: function(e) {
    // code stuff
    }
  
    // Can add another method and properties
}

// Syntax for Using addListener method:
MYAPP.event.addListener("anynm", "type", callback); 
 

Monday 24 August 2015

How to get Javascript microphone audio level peaks



How to get audio in javascript


Allow Audio


Javascript example of get audio peaks from microphone

this is a simple audio api peaks demo when user input on mic its upperlevel  increase 

mic must require

Saturday 22 August 2015

How to use for each loop in javascript

 

 

How to use javascript each with array:

Javascript how to use for each loop with array:

 
var a = ["a", "b", "c"];
a.forEach(function(entry) {
 
    alert(entry);
 
});
 

Friday 21 August 2015

how to Start and Stop marquee


 

Javascript Start - Stop Functions

How to start and stop marquee

Javascript:start();

Javascript:stop(); 

  Mouse over on scrolling text

Scrolling text Scrolling text Scrolling text Scrolling text

Wednesday 19 August 2015

How to vibrate mobile using javascript

Javascript mobile vibrate

 
 if ("vibrate" in navigator) {
 // vibration API supported
}
 
navigator.vibrate([500, 300, 100]);  for pattern vibrate
 
navigator.vibrate(200);  for single Milli seconds
 
 
 
 


 
  
 
 
 

How to make PDF using javascript

 

How to make PDF using javascript 

 

<!DOCTYPE html>
<html>
  <body>
    <p id="notprint">don't print this in pdf file</p>
    <div>
<p><font size="3" color="red">print this to pdf</font></p>
    </div>
  </body>
</html>
 
  • jspdf.js

  • jspdf.plugin.from_html.js

  • jspdf.plugin.split_text_to_size.js

  • jspdf.plugin.standard_fonts_metrics.js

this all above files for reference in head tag 



var doc = new jsPDF();          
var elementHandler = {
  '#notprint': function (element, renderer) {
    return true;
  }
};
var source = window.document.getElementsByTagName("body")[0];
doc.fromHTML(
    source,
    15,
    15,
    {
      'width': 180,'elementHandlers': elementHandler
    });

doc.output("dataurlnewwindow");

Monday 17 August 2015

Javascript Object Method

Object Methods

In addition to properties, objects can have methods. An object’s method is a function it can perform. Let’s take a look at this example. For this one, let’s create a Circle object. First, we’re going to have to define our functions, and then make them methods of our Circle object. Let’s define our Circle() constructor and a Circle object or two:

function Circle(radius){  

  this.radius = radius;  

}  

  

var bigCircle = new Circle(100);  

var smallCircle = new Circle(2);

Javascript simple object image

Javascript Object

An object is a collection of properties. These properties can either be primitive data types, other objects, or functions (which in this case are called methods, but more on this later). A constructor function (or simply, constructor) is a function used to create an object – this too we’ll discuss in detail later. JavaScript comes with many built-in objects, such as the Array, Image, and Date objects. Many of you are familiar with Image objects from creating those ever-so-cute rollover effects. Well, when you use the code


var Image1 = new Image();  

Image1.src = "xyz.gif";

Make Object In javascript

function jobj(){
};

function jobj(){
    this.nm= 'an object';
    this.do = function(){
        alert('my name ' + this.nm);
    };
};

 

Subscribe to our Newsletter

Contact our Support

Email us: youremail@gmail.com

Our Team Memebers