Modify to simple ID in Ajax voting script

Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
Nike555
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
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
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?

Admin
I think you changed well the code, if it works in your website, it is ok.

Similar Topics