File: example.html

Recommend this page to a friend!
  Classes of Arturs Sosins  >  Feedback Easy  >  example.html  >  Download  
File: example.html
Role: Example script
Content type: text/plain
Description: Example file
Class: Feedback Easy
Collect user feedback using Google Analytics
Author: By
Last change:
Date: 9 years ago
Size: 2,354 bytes


Class file image Download
 * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
 * Feel free to distribute and modify code, but keep reference to its creator
 * Feedback Easy can provide website visitors with option 
 * to rate website and/or leave small comment.
 * Ratings and comments are saved as google analytic events.
 * For more information, examples and online documentation visit: 
 * http://webcodingeasy.com/JS-classes/Collect-feedback-using-Google-Analytic
<style type='text/css'>
	text-align: center;
	width: 250px;
#feedback > div
	margin-top: 5px;
	margin-bottom: 5px;
	margin-left: auto;
	margin-right: auto;
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-9806969-27']);

  (function() {
    var ga = document.createElement('script'); 
	ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www')
	+ '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; 
	s.parentNode.insertBefore(ga, s);
<div id='feedback'></div>
<script type="text/javascript" src="./feedback_easy.packed.js" ></script>
<script type="text/javascript">
var f = new feedback_easy("feedback",{
	//maximal rating unit
	max: 5,
	//allow to leave comment
	comment: true,
	//allow to close form without feedback
	allow_close: true,
	//graphic for empty rating unit
	graphic_empty : "./star_empty.png",
	//graphic for full rating unit
	graphic_full : "./star_full.png",
	//encouraging text
	rate_text : "Rate this website:",
	//thank you text
	thanks_text: "Thank you for feedback",
	//text for submit button
	submit_text: "Submit",
	//text for close link
	close_text: "x",
	//callback function for submitted form
	callback : null,
	//callback function for closed form
	onclose : function(){
		document.getElementById("feedback").style.display = "none"
	//do not allow to submit empty comment input
	force_comment: false