Project

General

Profile

Actions

Bug #5609

closed

jquery inside widgets need to be added manually

Added by jeroen van breedam over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Web Interface
Target version:
-
Start date:
12/07/2015
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:

Description

is it intended that you'd need to manually set static paths to the various jquery*.js files inside the widgets ?

Actions #1

Updated by Anonymous over 8 years ago

  • Status changed from New to Feedback
  • Assignee set to jeroen van breedam

No. Not unless you are calling a function that is unique to your package (ie not included by foot.inc)

Note that jQuery is loaded by foot.inc so it may not have been loaded by the time you first call it. The solution is to wrap your jQuery in events.push like this:

events.push(function(){
$('#mytextbox').text("Hello");
});

Actions #2

Updated by jeroen van breedam over 8 years ago

yes that works with jquery inside a <somewidget.php> file.

however i can't get that solution to work with a <somewidget.js> file in /usr/local/www/widgets/javascript/
if i put them functions inside an events.push(), then they just don't execute.

I'm probably missing something obvious.

Actions #3

Updated by Anonymous over 8 years ago

It might be instructive to look at the thermal sensors widget. It uses a .js from widgets/javascript, and that js file contains jquery calls.

Actions #4

Updated by Chris Buechler about 8 years ago

  • Category set to Web Interface
  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF