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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marvin Hlavac
    Member
    • Sep 2007
    • 98

    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.
  • Paul M
    Former Lead Developer
    vB.Com & vB.Org
    • Sep 2004
    • 9886

    #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

    Comment

    • Marvin Hlavac
      Member
      • Sep 2007
      • 98

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

      Comment

      • Marvin Hlavac
        Member
        • Sep 2007
        • 98

        #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);
        // -->
        </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, 4:14am.

        Comment

        • Simon Lloyd
          Senior Member
          • Apr 2008
          • 610
          • 3.7.x

          #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,
          Simon
          Microsoft Office Discussion

          Comment

          • Marvin Hlavac
            Member
            • Sep 2007
            • 98

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

            Comment

            • Paul M
              Former Lead Developer
              vB.Com & vB.Org
              • Sep 2004
              • 9886

              #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

              Comment

              • Marvin Hlavac
                Member
                • Sep 2007
                • 98

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

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...