Skip to main content
added 1 character in body
Source Link
Submits
  • 3.3k
  • 3
  • 23
  • 37

Rather than using $(document).ready() try this:

<script>
_spBodyOnLoadFunctionNames.push("ButtonFunc");

function ButtonFunc() {
   $('.ms-qcb-leftzone').append('<li class="ms-qcb-item"><a href="http://www.google.com">ButtonName</a></li>');
})
<script></script>

If this doesn't work check that the selector $('.ms-qcb-leftzone') is actually finding something by doing something like:

var elems = $('.ms-qcb-leftzone');
console.log(elems.length);

Rather than using $(document).ready() try this:

<script>
_spBodyOnLoadFunctionNames.push("ButtonFunc");

function ButtonFunc() {
   $('.ms-qcb-leftzone').append('<li class="ms-qcb-item"><a href="http://www.google.com">ButtonName</a></li>');
})
<script>

If this doesn't work check that the selector $('.ms-qcb-leftzone') is actually finding something by doing something like:

var elems = $('.ms-qcb-leftzone');
console.log(elems.length);

Rather than using $(document).ready() try this:

<script>
_spBodyOnLoadFunctionNames.push("ButtonFunc");

function ButtonFunc() {
   $('.ms-qcb-leftzone').append('<li class="ms-qcb-item"><a href="http://www.google.com">ButtonName</a></li>');
})
</script>

If this doesn't work check that the selector $('.ms-qcb-leftzone') is actually finding something by doing something like:

var elems = $('.ms-qcb-leftzone');
console.log(elems.length);
Source Link
Submits
  • 3.3k
  • 3
  • 23
  • 37

Rather than using $(document).ready() try this:

<script>
_spBodyOnLoadFunctionNames.push("ButtonFunc");

function ButtonFunc() {
   $('.ms-qcb-leftzone').append('<li class="ms-qcb-item"><a href="http://www.google.com">ButtonName</a></li>');
})
<script>

If this doesn't work check that the selector $('.ms-qcb-leftzone') is actually finding something by doing something like:

var elems = $('.ms-qcb-leftzone');
console.log(elems.length);