Announcement

Collapse
No announcement yet.

What is this small inline javascript for, can I remove it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Marvin Hlavac
    replied
    Hi Paul,

    I've implemented it now on my main site.

    The reason for this is simply to remove all unnecessary code to make the site load as fast as possible. Every 100 bytes counts.

    (By putting an IF in the template, you are actually increasing processing)
    I cache entire pages for guests, so the <if> should not be of much concern. My forum has many more guests than members visiting daily.

    Thanks all for help.

    Leave a comment:


  • Paul M
    replied
    If you dont allow guests to post, removing those four just for guests would probably not have much effect. On the otherhand, why bother, they are not going to harm anything at all by just leaving them alone. You are worrying about things that really dont need worrying about. (By putting an IF in the template, you are actually increasing processing).

    Leave a comment:


  • Marvin Hlavac
    replied
    Hi Simon, I think I have Ajax features disabled for guests, so that would not bother me. I'm I think mainly concerned if features such as registration and loggin-in would be negatively impacted. I've done a few brief tests, and I was able to register and log in successfully. But still I'd like some more feedback.

    Leave a comment:


  • Simon Lloyd
    replied
    I'm not sure but i believe that if users have javascript turned off they wont see the Non-Ajax default -don't quote me on that though

    Leave a comment:


  • Marvin Hlavac
    replied
    A couple of months have passed since my last post. I'd like to ask again, if anyone knows, which function, if any, would be broken, if I remove, from the view of guests, the following javascript:



    <script type="text/javascript">
    <!--
    var SESSIONURL="$session[sessionurl_js]";
    var SECURITYTOKEN="$bbuserinfo[securitytoken]";
    var IMGDIR_MISC="$stylevar[imgdir_misc]";
    var vb_disable_ajax=parseInt("$vboptions[disable_ajax]",10);
    // -->
    </script>


    In my test forum, I've placed the above code in the <if condition="$show['member']"> </if> conditional, and I see nothing broken at the moment.

    Any insight would be much appreciated.
    Last edited by Marvin Hlavac; Sun 4 Dec '11, 5:14am.

    Leave a comment:


  • Marvin Hlavac
    replied
    Hi Paul,

    I'm in the process of removing all unneeded code. Could you please tell me, as an example, at least a single important function that would be broken if the above script was removed from pages served to guests?

    When I'm 100% sure I should not remove the script, I will leave it alone and go do something else.

    Your help is much appreciated!

    Leave a comment:


  • Paul M
    replied
    No, you cannot remove it, its used by various functions.

    (Not sure what the vba function is, thats not standard).

    Leave a comment:


  • What is this small inline javascript for, can I remove it?

    Hello,

    Would someone be so kind and explain what the function of the code attached below is? Could I remove it at least for guests? Is there any downside to removing the small inline javascript from the pages served to guests?

    Code:
    <script type="text/javascript"> <!--
    var SESSIONURL = "";
    var SECURITYTOKEN = "guest";
    var IMGDIR_MISC = "images/misc";
    var vb_disable_ajax = parseInt("0", 10);
    // --> </script> <script type="text/javascript"> <!--
    function vba_attach_win(threadid)
    {
        openWindow('http://www.XXXXXXXX.com/misc.php?do=showattachments&t=' + threadid, 480, 300);
    }
    --> </script>
    Any help will be much appreciated.
Loading...
Working...
X