Skip to content
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

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

Open
ibond opened this issue Jun 23, 2012 · 0 comments

Comments

@ibond
Copy link

ibond commented Jun 23, 2012

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);

})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant