Attributes requires different string for IE and FF?

0 views
Skip to first unread message

Andreas Söderlund

unread,
Jul 25, 2009, 4:33:46 AM7/25/09
to Pure-Unobtrusive...@googlegroups.com
I've noticed that when specifying output for an attribute in a
directive, it seems like if the output contains a space, IE requires
that the output string must be enclosed in single quotes, otherwise it
will break the library (on line 604 in pure2.js, the innerHTML line).
FF however requires no quotes at all or it won't work. Am I doing
something wrong when returning the value from the function, or is it a
bug?

Html:

<div id="list">
<p>Title</p>
<a class="name" style="display:block;" href="#">Link</a>
</div>

Javascript:

function testMe(nr, nr2) {
alert(nr + nr2);
}

var directives = {
'p': 'title',
'a': {
'row <- rows': {
'.' : 'row.name',
'.@onclick' : function(arg) {
return "testMe(1, 2);"; // Works in FF, not IE
//return "'testMe(1, 2);'"; // Works in IE, not FF
}
}
}
};

var listTemplate = $('#list').compile(directives);

data = {'title': title, 'rows' : [{name: 'Test1'}, {name: 'Test2'}]};
$('#list').render(data, listTemplate);

Yves (BeeBole)

unread,
Jul 27, 2009, 12:40:48 AM7/27/09
to PURE Unobtrusive Rendering Engine for HTML
Hi Andreas,

Mic is currently on holidays.

He should be back end of the next week.

Yves

Mic Cvilic

unread,
Aug 7, 2009, 4:00:45 PM8/7/09
to Pure-Unobtrusive...@googlegroups.com
Hi Andreas,

I've opened a ticket at
http://beebole.lighthouseapp.com/projects/16663-pure/tickets/29
If you go to the page and click "watch", you'll be notified by email of
any news.
Thanks for reporting the issue.

Cheers,
Mic
Reply all
Reply to author
Forward
0 new messages