jQuery requests

I'm not sure if this is right or not, but I discovered a great little tool for developers that user jquery's GET.


                        if (jQuery.active >2 ){return;}


Where I am right now, the internet is not the greatest, and the whole complex sometimes has severe internet slow downs.  

While watching my site in the console log I noticed sometimes I'd have up to 20 jquery get requests pending, making the browser sluggish, and the computer slow down.

I added this code in 4 different modules that do updates with the jquery GET command.

What happens is if there are more than 2 jquery requests pending, it just exits the script and doesn't pile them on.

It seems to help on my phone as well (when I have bad signal strength).

If this is the wrong approach, please let me know.

One place this  helps is  flash->modules->global->install->integrations->integrations.js

 

function updateRayUserStatus(sUserId)
{
    var XMLHttpRequestObject = false;       
    if(userId != "")
    {           
        if (jQuery.active > 2){return;}


Also, I did this for my wall where I am auto updating the posts.

And a couple other vendors modules as well that attempt to update content live.

If anyone has any feedback about this, it would be appreciated.

jQuery is not one of my stronger suites, but I like to think I can tinker with it some.

http://www.mytikibar.com
Quote · 28 Apr 2015

I would suggest to add it to templates/base/extra_top_menu.html file in update_bubbles:function() as well

Rules → http://www.boonex.com/terms
Quote · 3 May 2015

Awesome tip!  I added it!

http://www.mytikibar.com
Quote · 3 May 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.