(function($) {

  $(document).ready(function() {
    $('.license_box').first().prepend('<img class="qrcode printonly" ' +
        'src="https://chart.googleapis.com/chart?chs=70x70&amp;cht=qr&amp;choe=UTF-8&amp;chl=' +
        encodeURIComponent($('.mobile_link').first().href + /\d+/.exec(window.location.href)) + '"><br>');
  });

})(jQuery);
(function($) {

  // add the qrcode to the document once dom is loaded
  $(function() {
    $('.license_box').first().prepend('<img class="qrcode printonly" ' +
        'src="https://chart.googleapis.com/chart?chs=70x70&amp;cht=qr&amp;choe=UTF-8&amp;chl=' +
        encodeURIComponent($('.mobile_link').first().href + /\d+/.exec(window.location.href)) + '"><br>');
  });

})(jQuery);

use jquery instead of prototype