Project

General

Profile

Actions

Bug #1429

closed

require() causes errors in WidgetSet mode

Added by Boris Nagaev about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
09/07/2012
Due date:
% Done:

0%

Estimated time:

Description

Calling require() in WidgetSet mode prevents Wt from including internal jquery into output.

Wt 3.2.1


Files

widget-set-require.cpp (1.15 KB) widget-set-require.cpp test case Boris Nagaev, 10/05/2012 10:48 AM
text-bug.js (34.4 KB) text-bug.js Output, generated by Wt WidgetSet with require Boris Nagaev, 10/05/2012 10:48 AM
text-ok.js (95.5 KB) text-ok.js Output, generated by Wt WidgetSet without require Boris Nagaev, 10/05/2012 10:48 AM
Actions #1

Updated by Koen Deforche about 12 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.2.3
Actions #2

Updated by Koen Deforche about 12 years ago

  • Status changed from InProgress to Feedback

Hey,

I can't reproduce that. In either case (widgetset or plain application), the JQuery script is included as the first part of the "Wt script" ?

Perhaps there is some other reason that you get an error? Do you have a test-case or hints on how to reproduce this ?

Regards,

koen

Updated by Boris Nagaev about 12 years ago

Hello!

Here is a test case for this.

If require is not commented out, the following error is produced in google chrome inspector: "Uncaught ReferenceError: $ is not defined".

Temporary workaround: add

for JQuery and other "required" things alongside of

for widget set:

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
<script src='/text.js' type='text/javascript'></script>
Actions #4

Updated by Koen Deforche about 12 years ago

  • Status changed from Feedback to Resolved

Hey,

That didn't work (anymore) indeed. As mentioned elsewhere, you'll need to use requireJQuery() in Wt 3.2.3 to load the custom JQuery library.

Regards,

koen

Actions #5

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF