Comments (4)
Using new('div')
would read better aloud, and make more intuitive sense as english. In my brief tests, having a member function of an object called new()
does NOT conflict with the JS new
keyword.
from bonzo.
im digging this. should we worry about new
'ing multiple elements, at all? that might be dumb and complicating things that don't need to be. i'm all for this alias though.
from bonzo.
It's really just an alias for document.createElement(tagname)
, the overhead of bonzo.create()
can be completely avoided for this case. But because it's just duplicating an existing function that's available across browsers then perhaps this is just fluff?
from bonzo.
We did this on Medium.com
in an internal version of ender (just extending $
).
$.createElement = function (tagName) {
return $(document.createElement(tagName))
}
there were cases in the Editor where i'd need to create an Ender element out of a tag name. and it was more of a hassle to do this...
$('<' + tagName + '/>')
from bonzo.
Related Issues (20)
- $("ele").append() strips text in a mixed string. HOT 4
- toggleClass appends existing classes to className HOT 11
- Why `scrollWidth` and `offsetWidth`? HOT 1
- Add a version tag for bower HOT 4
- Add DOM Insertion, Around methods
- .focus() isn't working HOT 1
- Cannot set value of element if value is not a string
- .closest() skips origin element HOT 8
- Ender Bridge has issues with .width() and .height() on window and document. HOT 1
- Object offset() does not take margin into consideration. HOT 3
- CSS Opacity and Internet Explorer HOT 2
- .replaceWith() doesn't work when replacing a node with itself HOT 1
- Repository Command Error: version not found: 1.4.0 : bonzo/1.4.0 HOT 2
- Data method is not camelcasing hyphen separated properties HOT 2
- Window scrollTop resets scrollLeft and vice versa HOT 1
- Bower
- wrap
- bonzo doesn't specialcase "required" attr
- Only works if url does not have sub directories HOT 1
- Classie not getting included in webpack bundle. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bonzo.