Coder Social home page Coder Social logo

laconic's People

Contributors

bruslim avatar joestelmach avatar raynos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laconic's Issues

"String contains an invalid character" error when passing an array of elements with no attribute object.

Trying to pass an array of elements with no attribute object causes "String contains an invalid character" error (tested on firefox). It appears that this is because it tries to use the array as the attribute object.

Example JSFiddle: http://jsfiddle.net/XZN8X/16/

$(function() {
// Passing in individual elements works.
var works = $.el.div($.el.p("A1"), $.el.p("B1"));
$('#works').html(works);

// Passing in that same array with an empty attributes object works.
var worksWithExplicitAttributes = $.el.div({}, [$.el.p("A2"), $.el.p("B2")]);    
$('#worksWithExplicitAttributes').html(worksWithExplicitAttributes);

// Passing in an array of those elements fails.
var fails = $.el.div([$.el.p("A3"), $.el.p("B3")]);    
$('#fails').html(fails);

})

Creating form elements with a 'name' attribute fails in old IEs

IE 7 and 8 have no idea how to set the name attribute on elements once they have been created, this means that you can never create an element with a name attribute via laconic.

The workaround for this is a bit unfortunate (and this version relies on jQuery):

//http://webbugtrack.blogspot.com.au/2007/10/bug-235-createelement-is-broken-in-ie.html

var oldIE = $.browser.msie && $.browser.version < 9,
      el;

if(oldIE && arguments[1] && typeof arguments[1] === 'object' && arguments[1].name){

    el = document.createElement('<' + arguments[0] + ' name="' + arguments[1].name + '">');

}else{

    // create a new element of the requested type
    el = document.createElement(arguments[0]);

}

There may be other attributes that IE cannot set after creating an element, which could be solved by looping over the settings and injecting them into that string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.