Free Text to speech using Google service

I was looking for some text to speech service to get good mp3 file for some text in my project and I found couple of paid services which are really great but having this as part time project I wouldn’t pay. So I kept looking and I found that Google provide text to speech service. just use the following url and pass the text as q parameter and url generate MP3 output which you can store and use it.{text} There are also some PHP wrapper classes available which uitlize same service.

check out these links for more info

using javascript, you can also use audio class to play mp3 from web url like as follow.

var audio = new Audio();
audio.src ='';;

Export canvas drawing to image

Often you would like to export or save image generated on canvas.

here is simple script which does exactly the same.

to get string output to save image you can use stringOutput.

If you run following script you might get following error

Uncaught Error: SECURITY_ERR: DOM Exception 18

As browser can’t set cookies on file://, to run successfully you have to host file on web server.

var c = document.getElementById("sketch");
var dataString = c.toDataURL("image/png");
var index = dataString.indexOf( "," )+1;
var stringOutput = dataString.substring( index );;

Detect touch using js

use following function to detect touch supportive browser using javascript

function isTouchDevice() {
	   var el = document.createElement('div');
	   el.setAttribute('ongesturestart', 'return;');
	   return typeof el.ongesturestart === "function";

Awesome wordpress ecommerce themes

Bootstrap is amazing font end framework with list of css and javascripts which allows designer to design amazing website with ease. During my previous project I was looking for boostrap based e-commerce templates which might suite for wordpress templates as well. Following templates which I fond really easy and to start with. You might think the same.


Click Here to download


Click Here to download


Click Here to download


Click Here to download


Click Here to download


Click Here to download


Click Here to download


Click Here to download

How to fire event using javascript

how to create custom event and fire using javascript

the following code shows how you can fire event using javascript by create event object and use either dispatchEvent or fireEvent function of DOM element to fire event.

function fireClickEvent(obj){
	var event;
		event = document.createEvent("HTMLEvents"); // for chrome and firefox
		event.initEvent("click", true, true);
		event = document.createEventObject(); // for IE
		event.eventType = 'click';
		obj.dispatchEvent(event); // for chrome and firefox
		obj.fireEvent("on" + event.eventType, event); // for IE