S
S
SAKsak2018-03-02 21:32:58
JavaScript
SAKsak, 2018-03-02 21:32:58

What does Uncaught ReferenceError: jRS is not defined at HTMLAnchorElement.onclick mean?

Hello.
I ask for help with javascript, I myself am a complete zero in this.
This is how it goes. There is a forum on phpBB, it's almost clean, it's on localhost for now (on OpenServer, to be precise).
download mod from offsite

spoiler
https ://www.phpbb.com/community/viewtopic.php?f=70&t=2147118

There are no problems with the installation, but when you click on "raise reputation" (or anywhere else related to the mod), the page returns to the beginning, in other words, to the top, and a jQuery pop-up window should be called. Accordingly, the mod does not work.
The console says
Uncaught TypeError: Cannot read property 'positive' of undefined
    at HTMLAnchorElement.onclick (VM1857 viewtopic.php?f=2&p=3:578)

All paths to js-files (and there are only 3 of them) are spelled out correctly, I checked it more than once.
I am attaching the archive with these three js
spoiler
http: //my-files.ru/Save/p3sr25/phpBB-Reputation-System-0.7.0.zip

Help, please, who can.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SAKsak, 2018-03-02
@SAKsak

obsolete

spoiler
Вот часть кода, куда отсылает консоль (как я понял)
var jRS = {
  showhide: function(a) {
    $(a).parents('.post').toggleClass('hidden');
  },
  positive: function(a, b, c) {
    show_popup('positive', a, b, c);
  },
  negative: function(a, b, c) {
    show_popup('negative', a, b, c);
  },
  postdetails: function(a) {
    show_popup('postdetails', a);
  },
  userdetails: function(a, b) {
    show_popup('userdetails', a, b);
  },
  userrating: function(a, b) {
    show_popup('rateuser', a, b);
  },
  ratepost: function(id) {
    submit_action('post', id);
  },
  rateuser: function(id) {
    submit_action('user', id);
  },
  del: function(id, mode) {
    if(confirm(rsdelete))
    {
      submit_action('delete', id, mode);
    }
  },
  clear: function(id, mode, page) {
    switch(mode)
    {
      case 'post':
        confirm_clear = rsclearpost;
      break;
      case 'user':
        confirm_clear = rsclearuser;
      break;
    }
    if (confirm(confirm_clear))
    {
      submit_action('clear', id, mode, page);
    }
  },
  catchup: function() {
    submit_action('catchup');
  },
}

Подскажите, как его поправить
Problem solved , addedjQuery.noConflict();

S
Sergey Karakulov, 2018-03-02
@zero-cool

This means that on click, the event handler, or the code it calls, tries to use the value of the "positeve" property, but that property has no value, hence the error;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question