-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lighter syntax for create()
?
#94
Comments
Using |
im digging this. should we worry about |
It's really just an alias for |
We did this on $.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 + '/>') |
Discussed this with @rvagg in IRC briefly. Here's the alias I would propose:
It could obviously be implemented more performantly as a direct interface to the DOM, but I think it would be a more intuitive API. The current name
create()
evokes the native DOM'sdocument.create()
, which accepts a tag name, not a tag. So intuitively I always want to writebonzo.create('div')
, and notbonzo.create('<div>')
. That was perhaps the most recurring hitch in my adjustment to the API, FWIW.The text was updated successfully, but these errors were encountered: