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

$.tmpl returns lots of <TextNode> elements #161

Open
marlun78 opened this issue Nov 10, 2011 · 4 comments
Open

$.tmpl returns lots of <TextNode> elements #161

marlun78 opened this issue Nov 10, 2011 · 4 comments

Comments

@marlun78
Copy link

I know the project has been canceled, but it would be nice if someone who knows how could fix this problem.

@BorisMoore
Copy link
Owner

You would need to post a simple test case to jsfiddle, for someone to help you here. It may be your issue is an error in your code, or template, not in jquery.tmpl....

@marlun78
Copy link
Author

marlun78 commented Jan 3, 2012

Yeah, sorry about that! It was not a jquery.tmpl problem. Well sort of. The problem had to do with whitespace in the template file. Once I removed that, it worked fine.

@PrisonerZERO
Copy link

I am getting the same issue, but I have no white spaces. In the meantime:

This returns a TextNode?
$('

${Text}
').tmpl(instance)

...and yes, instance contains a property called 'Text' (e.g. instance.Text
)

This returns EMPTY?
$("

").tmpl(instance)

This returns EMPTY?
$('

').tmpl({})

@ChrisMalone
Copy link

First and foremost, each template needs a wrapper.. This is a dummy tag. Any template not contained in a script tag must be wrapped within a dummy tag. (this is probably because the resulting selectors “HTML()” method is used to return desired markup). Additionally, invalid html will cause it to return empty object.
For example, putting a td tag inside a div.

Also see http://bugs.jquery.com/ticket/7188

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

4 participants