I'm making a JS/PHP plugin for distribution. I want it to be as easy to install as this:
<HTML>
<HEAD>
<TITLE>Testing my Plugin</TITLE>
<?php
include 'path/to/myPlugin.php';
echo getMyPluginHeadContent();
?>
</HEAD>
<BODY>
<?php
echo getMyPluginContent("Arguments will go here");
?>
</BODY>
</HTML>
However, I want this plugin to attach a window resize listener without overriding window.onresize
, in case there are any other scripts that also require the use of that method. Is there any javascript command like document.addEventListener("resize", myResizeMethod, true);
? I know that's not it, because that's not working, and the MDN and W3C are very vague about what arguments addEventListener
takes.
I do not want an answer telling me to use window.onresize = myResizeMethod
or <BODY ONRESIZE="myResizeMethod">
, as these are not as plugin-friendly.