Modify to simple ID in Ajax voting script
-
- Posts:12
Modify to simple ID in Ajax voting script
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?
Admin
Posts:805
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.
Nike555
Posts:12
Thanks for answers)
1 from changes i modified this row in voting.js
to
for simple ID-s, i fine changed this row?
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) {
Code: Select all
if(obj_div[i].className=='vot_plus' || obj_div[i].className=='vot_updown1' || obj_div[i].className=='vot_updown2') {
Admin
Posts:805
I think you changed well the code, if it works in your website, it is ok.