Ajax Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Ajax Scripts
Ajaxscripts List All
Rating/Voting Scripts Rating/Voting Scripts
Form Effects Form Effects
Validation Script Validation Script
Dynamic Form Dynamic Form
Pagination Pagination Script
Mouse Effects Mouse Effects
 





Ajax Up/Down Voting Script


About
Simple Ajax Up/Down Voting Script that allows users to vote an item in a webpage. The easiest way for voting anything on your web site. Allow users to click on the up and down arrows to vote the events.


Features
a) Free Script for websites where users could vote if they "Like" or "Don't Like" the events.
b) Easy customization - change colors, fonts and styles using CSS.
c) No database is required as results are stored in file.
d) Voting script that supports almost all browsers.

Preview

Ajax Up/Down Voting Script


Code
Copy and Paste the script to make it use in your webpage.

Javascript Code
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script type="text/javascript">
var httpa;
var browser = navigator.appName;
function createRequestObject(){
        var request_o; //declare the variable to hold the object.
        if(browser == "Microsoft Internet Explorer"){
                /* Create the object using MSIE's method */
                request_o = new ActiveXObject("Microsoft.XMLHTTP");
        }else{
                /* Create the object using other browser's method */
                request_o = new XMLHttpRequest();
        }
        return request_o; //return the object
}
function setrating(val,id)
{
        httpa = createRequestObject(); 
        var str="addrating.php?id="+id+"&value="+val;
        httpa.open('get', str);
        httpa.onreadystatechange = handleResponse;
        httpa.send(null);
}
function handleResponse() {
        if(httpa.readyState == 4){
        var response = httpa.responseText;
        document.getElementById('prc').value=response;        
   }
}

</script>

<!-- Script by hscripts.com -->

HTML Code
<table style='border:1px solid green;' cellspacing=0 cellpadding=0><tr><td>
<input id=prc name=prc type=text size=6 value=1 readonly style='background-color: white; border: 0px;'>
<img border=0 src="uarrow.gif" onclick="setrating(document.getElementById('prc').value,'uarrow');">
<img border=0 src="darrow.gif" onclick="setrating(document.getElementById('prc').value,'darrow');">
</td></tr></table>


Downloads:Up and Down Script.zip

Release Date - 05-01-2010
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
a) Download and unzip the Up/Down Voting Script.
b) Copy and paste the javascript code into your HTML page and make use of this Like and Don't Like script.
c) Here, the function "setrating()" is used to increase and decrease the voting value using ajax.
d) Easy to setup and customise.

License
- Ajax Scripts are given under GPL License
- i.e. Free use for those who use the examples as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet GPL License terms.
Other Links

web hosting