No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

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


    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?

    <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('' + threadid, 480, 300);
    --> </script>
    Any help will be much appreciated.

  • #2
    No, you cannot remove it, its used by various functions.

    (Not sure what the vba function is, thats not standard).
    Baby, I was born this way


    • #3
      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!


      • #4
        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);
        // -->

        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.


        • #5
          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
          Kind regards,
          Microsoft Office Discussion


          • #6
            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.


            • #7
              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).
              Baby, I was born this way


              • #8
                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.