UNPKG

dollar-js

Version:

A lighter, faster, modular jQuery replacement (manipulate DOM, bind events, and more...)

98 lines (96 loc) 3.42 kB
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Limitations | DollarJS</title> <link href="../secondary.css" rel="stylesheet" /> </head> <body> <a href="../" class="back-btn" onclick="history.back(-1); return false;">Back</a> <h1>Limitations</h1> <div id="browsers"> <h2>Browser Support</h2> <table> <tr> <td></td> <td>Chrome</td> <td>Safari</td> <td>Firefox</td> <td>Edge</td> <td>&nbsp; IE &nbsp;</td> <td>Opera</td> </tr> <tr> <td>Desktop</td> <td class="darker-cell">Yes</td> <td class="darker-cell">Yes</td> <td class="darker-cell">Yes</td> <td class="darker-cell">Yes</td> <td class="darker-cell">9+</td> <td class="darker-cell">Yes</td> </tr> <tr> <td>iOS</td> <td class="darker-cell">Yes</td> <td class="darker-cell">Yes</td> <td class="darker-cell"></td> <td class="darker-cell"></td> <td class="darker-cell"></td> <td class="darker-cell"></td> </tr> <tr> <td>Android</td> <td class="darker-cell">Yes</td> <td class="darker-cell"></td> <td class="darker-cell"></td> <td class="darker-cell"></td> <td class="darker-cell"></td> <td class="darker-cell"></td> </tr> </table> </div> <div id="selectors"> <h2>Unsupported Selectors</h2> <p>The following selectors are currently unsupported.</p> <pre> $('h2[foo!="bar"]') </pre> </div> <div id="iterators"> <h2>Iterators</h2> <p><b>DollarJS universally uses a different style of iterator than jQuery.</b> The order of the parameters is different. This is an intentional choice because we believe this approach to be more adherent to JavaScript's accepted practices.</p> <p>An iterator in DollarJS</p> <pre> $('p').each(function (<span style="color:green">value, key,</span> collection) { console.log(value); }); </pre> <p>An iterator in jQuery</p> <pre> $('p').each(function (<span style="color:red">key, value,</span> collection) { console.log(value); }); </pre> </div> <div id="bindings"> <h2>Bindings</h2> <p>DollarJS does event bindings using addEventListener. Therefore, returning <b>false</b> from an event handler does not prevent the default behavior or stop the event from bubbling. This is <a href="http://stackoverflow.com/questions/4924036/return-false-on-addeventlistener-submit-still-submits-the-form" target="_blank">expected of addEventListener</a>.</p> <p>The following does NOT work</p> <pre> $('a').on('click', function (e) { return false; }); </pre> <p>You should do this instead</p> <pre> $('a').on('click', function (e) { e.preventDefault(); e.stopPropagation(); }); </pre> </div> <script src="../gatag.js"></script> <script src="https://raw.githubusercontent.com/seebigs/dollar-js/master/prebuilt/dollar.js"></script> <script src="../common.js"></script> </body> </html>