[Owncloud] Inline JS is going to be disabled - Important notice to all developers
Lukas Reschke
lukas at owncloud.org
Fri Jan 25 16:54:55 UTC 2013
Another ProTip™: If your app needs to pass some arguments to a
Javascript function you can use the HTML5 data attribute for this.
Template file:
==============
<input type="button" id="submit" data-link="<?php echo
OCP\Util::linkTo('appname', 'filename'); ?>" data-id="4" value="<?php
echo $l->t("Submit");?>">
Javascript file:
================
$('#submit').live('click', function () {
DoSomeWork($(this).data('link'), $(this).data('id'));
});
Example:
https://github.com/owncloud/apps/commit/cdf6ac9c0f6cf9b1ac927791eabc92790ab351aa
More information about the Owncloud
mailing list