Page 1 of 1

Modify to simple ID in Ajax voting script

Posted: 09 Feb 2016, 15:37
by Nike555
In this script: https://coursesweb.net/php-mysql/voting- ... pt-ajax_s2 , i will try to remove from scripts "vt_" in ID and will make simple id, not be anything worse? :)

Modify to simple ID in Ajax voting script

Posted: 09 Feb 2016, 17:39
by Admin
The "vt_" is used in javascript code to get the id. If you remove it, you'll have to make changes in votinng.js, in the getVotsElm() function.

Modify to simple ID in Ajax voting script

Posted: 09 Feb 2016, 20:46
by Nike555
Thanks for answers)
1 from changes i modified this row in voting.js

Code: Select all

if((obj_div[i].className=='vot_plus' || obj_div[i].className=='vot_updown1' || obj_div[i].className=='vot_updown2') && elm_id.indexOf("vt_")==0) {
to

Code: Select all

if(obj_div[i].className=='vot_plus' || obj_div[i].className=='vot_updown1' || obj_div[i].className=='vot_updown2') {
for simple ID-s, i fine changed this row?

Modify to simple ID in Ajax voting script

Posted: 10 Feb 2016, 07:51
by Admin
I think you changed well the code, if it works in your website, it is ok.