Bug #5609
closedjquery inside widgets need to be added manually
0%
Description
is it intended that you'd need to manually set static paths to the various jquery*.js files inside the widgets ?
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");
});
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.
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.
Updated by Chris Buechler about 8 years ago
- Category set to Web Interface
- Status changed from Feedback to Closed