Google +1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carlos 360
    Banned
    • May 2008
    • 551
    • 3.7.x

    #31
    Originally posted by a legacy reborn
    That is if the templates to be reverted includes that one , "People like you", a little harsh?
    Nah. I only said "people like you say it like."

    Comment

    • a legacy reborn
      Member
      • Feb 2010
      • 87

      #32
      Originally posted by Carlos 360
      Nah. I only said "people like you say it like."
      lulz...It just seemed like you were being a little critical of his post, it is not a hard thing to do and saying it is hard is the same as saying it is difficult to login to the admincp...

      Comment

      • we_are_borg
        Senior Member
        • Aug 2004
        • 5454
        • 4.2.X

        #33
        Originally posted by digitalpoint
        Well... I use jQuery for things on my site (including this), so it's not going to work unless you also use jQuery, even if you don't you get the general idea...
        Code:
        $(document).ready(function() {
            $('body').append('<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>');
        });
        So you are only adding the JavaScript files to your page AFTER the page has loaded (is "ready").
        DP in the clientscript directory there is a directory called jQuery i presume that this is now used throughout vBulletin software.

        Comment

        • digitalpoint
          Senior Member
          • Mar 2004
          • 2573
          • 4.1.x

          #34
          Nope... just used in a couple places (like the custom profile editor).
          Sphinx Search for vBulletin 4: https://marketplace.digitalpoint.com...tin-4.870/item
          Someone send me a message on Twitter when this site is usable again. https://twitter.com/digitalpoint

          Comment

          • woodee
            New Member
            • Apr 2011
            • 25

            #35
            Originally posted by digitalpoint
            Well... I use jQuery for things on my site (including this), so it's not going to work unless you also use jQuery, even if you don't you get the general idea...
            Code:
            $(document).ready(function() {
                $('body').append('<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>');
            });
            So you are only adding the JavaScript files to your page AFTER the page has loaded (is "ready").
            Thanks for this.
            Supplements Canada

            Comment

            • we_are_borg
              Senior Member
              • Aug 2004
              • 5454
              • 4.2.X

              #36
              Originally posted by digitalpoint
              Nope... just used in a couple places (like the custom profile editor).
              Not what i meant with my post i really need to be more clear with this, the jQuery thats included with vBulletin can be used any where in the software or is it only active in lets say the custom profile editor and other places its used.

              Comment

              • digitalpoint
                Senior Member
                • Mar 2004
                • 2573
                • 4.1.x

                #37
                It can be active as long as you include it. It's not loaded normally.
                Sphinx Search for vBulletin 4: https://marketplace.digitalpoint.com...tin-4.870/item
                Someone send me a message on Twitter when this site is usable again. https://twitter.com/digitalpoint

                Comment

                • we_are_borg
                  Senior Member
                  • Aug 2004
                  • 5454
                  • 4.2.X

                  #38
                  Originally posted by digitalpoint
                  It can be active as long as you include it. It's not loaded normally.
                  Thanks DP.

                  Comment

                  • digitalpoint
                    Senior Member
                    • Mar 2004
                    • 2573
                    • 4.1.x

                    #39
                    It's really not worth it to load the entire jQuery framework just to do it like that though. I only do it that way because I already have the jQuery framework loaded for other things.

                    If you don't already have a framework loaded for other purposes, I would just do something like this (not tested, off the top of my head... but it should work)... Then you don't have to load an extra JavaScript file.
                    Code:
                    (function() {
                    	var s = document.createElement('script');
                    	s.type = 'text/javascript';
                    	s.async = true;
                    	s.src = 'http://platform.twitter.com/widgets.js';
                    	document.getElementsByTagName('head')[0].appendChild(s);
                    	s.src = 'https://apis.google.com/js/plusone.js';
                    	document.getElementsByTagName('head')[0].appendChild(s);
                    })();
                    That will do a "lazy" non-blocking (asynchronous) load of the two JavaScript files.
                    Sphinx Search for vBulletin 4: https://marketplace.digitalpoint.com...tin-4.870/item
                    Someone send me a message on Twitter when this site is usable again. https://twitter.com/digitalpoint

                    Comment

                    • Taurus1
                      Senior Member
                      • Dec 2009
                      • 164
                      • 3.8.x

                      #40
                      Originally posted by digitalpoint
                      It's really not worth it to load the entire jQuery framework just to do it like that though. I only do it that way because I already have the jQuery framework loaded for other things.

                      If you don't already have a framework loaded for other purposes, I would just do something like this (not tested, off the top of my head... but it should work)... Then you don't have to load an extra JavaScript file.
                      Code:
                      (function() {
                          var s = document.createElement('script');
                          s.type = 'text/javascript';
                          s.async = true;
                          s.src = 'http://platform.twitter.com/widgets.js';
                          document.getElementsByTagName('head')[0].appendChild(s);
                          s.src = 'https://apis.google.com/js/plusone.js';
                          document.getElementsByTagName('head')[0].appendChild(s);
                      })();
                      That will do a "lazy" non-blocking (asynchronous) load of the two JavaScript files.
                      I would love to try that out. Thank you very much. So, would I just add that code at the bottom/top of my header template?

                      EDIT: Would it be possible to that for facebook too?
                      For custom designed Windows 7 Visual Styles/Themes, please visit CreativX!

                      Comment

                      • digitalpoint
                        Senior Member
                        • Mar 2004
                        • 2573
                        • 4.1.x

                        #41
                        The Facebook stuff is already more or less loading after the page loads with the default vBulletin implementation. If you look at the source of a vBulletin page, the clientscript/vbulletin_facebook.js and http://connect.facebook.net/en_US/all.js files are already at the end of the document, and the vBfb object isn't created until after the page has loaded via a YAHOO.util.Event.onDOMReady call. That's why I didn't bother changing it.
                        Sphinx Search for vBulletin 4: https://marketplace.digitalpoint.com...tin-4.870/item
                        Someone send me a message on Twitter when this site is usable again. https://twitter.com/digitalpoint

                        Comment

                        • Taurus1
                          Senior Member
                          • Dec 2009
                          • 164
                          • 3.8.x

                          #42
                          Originally posted by digitalpoint
                          It's really not worth it to load the entire jQuery framework just to do it like that though. I only do it that way because I already have the jQuery framework loaded for other things.

                          If you don't already have a framework loaded for other purposes, I would just do something like this (not tested, off the top of my head... but it should work)... Then you don't have to load an extra JavaScript file.
                          Code:
                          (function() {
                          	var s = document.createElement('script');
                          	s.type = 'text/javascript';
                          	s.async = true;
                          	s.src = 'http://platform.twitter.com/widgets.js';
                          	document.getElementsByTagName('head')[0].appendChild(s);
                          	s.src = 'https://apis.google.com/js/plusone.js';
                          	document.getElementsByTagName('head')[0].appendChild(s);
                          })();
                          That will do a "lazy" non-blocking (asynchronous) load of the two JavaScript files.
                          Hi DP, thanks, but where would I add this code? I what template?
                          For custom designed Windows 7 Visual Styles/Themes, please visit CreativX!

                          Comment

                          • digitalpoint
                            Senior Member
                            • Mar 2004
                            • 2573
                            • 4.1.x

                            #43
                            It's JavaScript... so maybe header template within <script> tags or something like that.
                            Sphinx Search for vBulletin 4: https://marketplace.digitalpoint.com...tin-4.870/item
                            Someone send me a message on Twitter when this site is usable again. https://twitter.com/digitalpoint

                            Comment

                            • Taurus1
                              Senior Member
                              • Dec 2009
                              • 164
                              • 3.8.x

                              #44
                              Originally posted by digitalpoint
                              It's JavaScript... so maybe header template within <script> tags or something like that.
                              Thanks for the help, but that does not work for me. Twitter still loads first.
                              For custom designed Windows 7 Visual Styles/Themes, please visit CreativX!

                              Comment

                              • bestmilan
                                Senior Member
                                • May 2007
                                • 153
                                • 3.8.x

                                #45
                                Originally posted by Project-Buckfast
                                Indeed. Takes only a few seconds to cut and paste into your template.
                                Btw, the XHTML W3 validation failed after adding google +1 button.

                                Use this <div class="g-plusone"></div> instead of <g:plusone></g:plusone>
                                www.legaljunkies.com

                                Comment

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