Advertisement:

Author Topic: deprecated JavaScript in info center/stats script.js  (Read 5484 times)

Offline oOo--STAR--oOo

  • Full Member
  • ***
  • Posts: 645
  • Perfectionist
    • Developing Uniquez
deprecated JavaScript in info center/stats script.js
« on: July 04, 2016, 02:47:17 AM »
Hey, in the info center, stats when you expand and collapse the months to view the days stats, you get a warning in console

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

Which points to this link

Code: [Select]
oMyDoc.open('GET', sUrl, bAsync);
You only seem to get the warning when collapsing the months...

This warning even exists on this forum.
You can't fool a sufficiently talented fool.

http://www.uniquez-home.com
In Design Phase!

Mods I am designing,  No refresh Collapse Categories , Poll Redesign , Pure CSS Breadcrumb , Profile Statuses, Profile Views.

Offline forumfan32

  • Semi-Newbie
  • *
  • Posts: 14
Re: deprecated JavaScript in info center/stats script.js
« Reply #1 on: July 12, 2016, 04:29:17 PM »
I had this problem about a month ago. Simple Machines only allows you to do async http requests.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: deprecated JavaScript in info center/stats script.js
« Reply #2 on: August 24, 2016, 07:01:01 PM »
This should really be using an AJAX endpoint if anything. Jeez the code is old. How I would love to make a fork.

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,956
  • Gender: Male
  • Black cat rulz!
    • XinYenFon on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • WoWSnips
Re: deprecated JavaScript in info center/stats script.js
« Reply #3 on: August 24, 2016, 07:06:25 PM »
This should really be using an AJAX endpoint if anything. Jeez the code is old. How I would love to make a fork.

We always welcome the patches.
Open for PAID works # Support Me

Current Project(s): [ WoWSnips ]
Past Project(s): [ ezPortal ] # [ Lunarfall ] # [ RDD (HTML5) ]

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: deprecated JavaScript in info center/stats script.js
« Reply #4 on: August 24, 2016, 10:47:24 PM »
The fix

Code: [Select]
oMyDoc.open('GET', sUrl);
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein