0

I am using jsrender, everything is working in Chrome, however in Firefox it`s not working.

If I try to get $('#theTmpl').html() in console (using Firefox), its coming " ". But in Chrome works perfectly.

Chrome:

Chrome

Firefox:

Firefox

Code:

<script id="theTmpl" type="text/x-jsrender" data-jsv-tmpl="jsvTmpl">
    <div>
            {{if TotalNumberOfResults == 0 }}
            <h3>
                No Results
            </h3>
        </div><div>
            {{else}}
            <h3 id="resultFoundText" style="display:none">
                Showing [[numberone]] of [[numbertwo]] matching [[searchtext]] :
            </h3>
            {{/if}}
        </div><div class="search-result-row">
            {{for Results}}
            <h4>
                {{for Fields}}
                {{if Key == 'item_indexed_link_t'}}
                <a href="{{:Value}}" class="link-text">
                    {{/if}}
                    {{/for}}
                    {{for Fields}}
                    {{if Key == 'title_t'}}
                    {{:Value}}
                    {{/if}}
                    {{/for}}
                    {{for Fields}}
                    {{if Key == 'item_indexed_link_t'}}
                </a>
                {{/if}}
                {{/for}}
                {{for Fields}}
                {{if Key == '_templatename'}}
                <span class="category">{{:Value}}</span>
                {{/if}}
                {{/for}}
            </h4>
            {{for Fields}}
            {{if Key == 'description_t'}}
            <p>{{:Value}}</p>
            {{/if}}
            {{/for}}
            {{/for}}
        </div><div id="loadMoreResult">
            {{if TotalNumberOfResults != 0 }}
            <a class="medtouch-btn danger" onclick="FillSearch(false,  null, true)">Load More Result</a>
            {{/if}}
        </div></script>
Sunil Chaudhary
  • 4,481
  • 3
  • 22
  • 41
Fernando Feks
  • 71
  • 1
  • 7
  • 1
    Works for me. If you create a jsfiddle with script calling $('#theTmpl').html() does in it work in Firefox? If not can you post the sample.... – BorisMoore Dec 17 '19 at 04:10
  • Works here too, but you might prefer `text()` anyway to access a – Kaiido Dec 17 '19 at 05:46

1 Answers1

0

This problem is encountered which many years if use JQuery and Firefox.

Try update JQuery and Firefox to last version.

Try no JQuery:

document.getElementById("theTmpl");

Similar problems:

Noneme
  • 816
  • 6
  • 22