Giter Club home page Giter Club logo

Comments (5)

BorisMoore avatar BorisMoore commented on July 18, 2024 1

To explain this issue:

The JSFiddle linked above includes the line:
<tbody data-link="{for people tmpl='#people .item-template'}"></tbody>

It loads the template under the script element with class "item-template", which is itself a descendant of the element (in fact a <div>) which has ID "people".

The selector '#people .item-template' - a "descendant selector" starts with a '#', and the previous JsRender code assumed that a selector starting with a '#' is an "ID selector". However the presence of white space in the selector means that it is not a valid "ID selector" and is in fact a "descendant selector". The bug fix ensures that JsRender no longer assumes that a selector starting with "#" is an "ID selector", and instead interprets the selector correctly, and so loads the correct template in the JSFiddle example.

The issue is with JsRender as well as with JsViews (which uses JsRender)

from jsviews.

BorisMoore avatar BorisMoore commented on July 18, 2024

Thanks for calling this out, Lee. I have a fix, which I will share with you in the coming days...

from jsviews.

BorisMoore avatar BorisMoore commented on July 18, 2024

You can test my proposed fix, using this updated version of jsviews.js:

jsviews1013.js.txt

It has line 1125:
} if (!elem && $.fn && !$sub.rTmpl.test(value)) {
which replaces the previous version:
} else if ($.fn && !$sub.rTmpl.test(value)) {

Let me know if this works for you.
Thanks

from jsviews.

nfplee avatar nfplee commented on July 18, 2024

Thanks yeah that seems to do the trick.

from jsviews.

BorisMoore avatar BorisMoore commented on July 18, 2024

Resolved in release v1.0.13

from jsviews.

Related Issues (20)

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.