Announcement

Collapse
No announcement yet.

Google +1

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

  • #31
    Originally posted by a legacy reborn View Post
    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


    • #32
      Originally posted by Carlos 360 View Post
      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


      • #33
        Originally posted by digitalpoint View Post
        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


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


          • #35
            Originally posted by digitalpoint View Post
            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


            • #36
              Originally posted by digitalpoint View Post
              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


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


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

                  Comment


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


                    • #40
                      Originally posted by digitalpoint View Post
                      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


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


                        • #42
                          Originally posted by digitalpoint View Post
                          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


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


                            • #44
                              Originally posted by digitalpoint View Post
                              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


                              • #45
                                Originally posted by Project-Buckfast View Post
                                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...
                                X