[SOLVED] $$(this).attr('data-name') with spaces

Hi There,

I have an issue with a VL and the parameter to pass. If the string contains spaces, it will not show the full string.


items.push({
	{title} = 'Hello World'
...


...
itemTemplate:
				'<li id="vao_swipe" data-name={{title}} >' +
				  '<a class="item-content item-link" href="#">'+
...


$$(document).on('click', '#vao', function (e) {
var result = $$(this).attr('data-name');
console.log(result) 
....

result-> ‘Hello’ but the expected string is ‘Hello World’

Any suggestion?

Thanks!

It is wrong writen {title} = ‘Hello World’,right here {title: ‘hello world’}

You lost " in html structure.

Bingo

We answer a lot of questions because people used the wysiwyg programming style of Jquery.
This is very different from OOP i.
More important reason is that F7 does not have good error tracking.
The framework hinders js error tracking, which can be a real pain for debugging.

Btw is there any way for F7 to get the exception thrown

Hi both,

All OK with “{{title}}”

Thanks for that!