Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: $.extend is not a function #73

Open
agusmakmun opened this issue Dec 26, 2021 · 0 comments
Open

TypeError: $.extend is not a function #73

agusmakmun opened this issue Dec 26, 2021 · 0 comments

Comments

@agusmakmun
Copy link

agusmakmun commented Dec 26, 2021

Here I'm using jQuery 3.6.0, some how I found this TypeError: $.extend is not a function,
it coming from var settings = $.extend({...}) inside feedback.js.

I also did initialize the jQuery itself, because I'm using react.

let $ = jQuery = function (selector, context) {
    // The jQuery object is actually just the init constructor 'enhanced'
    // Need init if jQuery is called (just allow error to be thrown if not included)
    return new jQuery.fn.init(selector, context);
};
$.feedback({
  ajaxURL: 'http://localhost:8000' + '/api/feedback/',
  html2canvasURL: 'http://localhost:8000/static/' + 'tellme/vendor/html2canvas/html2canvas.js',
  feedbackButton: '#feedback-btn',
  initButtonText: 'Send feedback',
  postHTML: false,
  tpl: {
    description: `
      <div id="feedback-welcome" class="rounded">
      <div>Report an Issue</div>
      <p>Feedback lets you send us suggestions about this site. We welcome problem reports, feature ideas and general comments.</p>
      <p>Start by writing a brief description:</p>
      <textarea class="form-control" id="feedback-note-tmp"></textarea>
      <p>Next we'll let you identify areas of the page related to your description.</p>
      <button id="feedback-welcome-next" class="btn btn-primary">Next</button>
      <div id="feedback-welcome-error">Please enter a description.</div>
      <div class="feedback-wizard-close"></div>
      </div>
    `,
    highlighter: `
      <div id="feedback-highlighter" class="rounded">
      <div>Report an Issue</div>
      <p>Click and drag on the page to help us better understand your feedback. You can move this dialog if it's in the way.</p>
      <button class="feedback-sethighlight feedback-active">
      <span class="ico"></span>
      <span>Highlight</span></button>
      <label>Highlight areas relevant to your feedback.</label>
      <button class="feedback-setblackout">
      <span class="ico"></span>
      <span>Black out</span></button>
      <label class="lower">Black out any personal information.</label>
      <div class="feedback-buttons">
      <button id="feedback-highlighter-back" class="btn btn-outline-primary">
      Back
      </button>
      <button id="feedback-highlighter-next" class="btn btn-primary">
      Next
      </button>
      </div>
      <div class="feedback-wizard-close"></div>
      </div>
    `,
    overview: `
      <div id="feedback-overview" class="rounded">
      <div>Report an Issue</div>
      <div id="feedback-overview-description">
      <div id="feedback-overview-description-text"><h3>Description</h3>
      <h3 class="feedback-additional">Additional info</h3>
      <div id="feedback-additional-none"><span>None</span></div>
      <div id="feedback-browser-info"><span>Browser Info</span></div>
      <div id="feedback-page-info"><span>Page Info</span></div>
      <div id="feedback-page-structure"><span>Page Structure</span></div>
      </div>
      </div>
      <div id="feedback-overview-screenshot"><h3>Screenshot</h3></div>
      <div class="feedback-buttons">
      <button id="feedback-overview-back" class="btn btn-outline-primary">Back</button>
      <button id="feedback-submit" class="btn btn-primary">Submit</button>
      </div>
      <div id="feedback-overview-error">Please enter a description.</div>
      <div class="feedback-wizard-close"></div>
      </div>
    `,
    submitSuccess: `
      <div id="feedback-submit-success">
      <div>Thank you</div>
      <p>Thank you for your feedback. We value every piece of feedback we receive.'%}</p>
      <p>We cannot respond individually to every one, but we will use your comments as we strive to improve your experience.</p>
      <button class="feedback-close-btn btn btn-primary">OK</button>
      <div class="feedback-wizard-close"></div>
      </div>
    `,
    submitError: `
      <div id="feedback-submit-error">
      <div class="feedback-logo">Feedback</div>
      <p>Sadly an error occurred while sending your feedback. Please try again.</p>
      <button class="feedback-close-btn feedback-btn-blue">OK</button>
      <div class="feedback-wizard-close"></div>
      </div>
    `,
  },
  initialBox: true
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant