views:

22

answers:

1

I'm using jTemplate & jQuery to query a .net Web Method, then display the results in a webpage.

Shown below is the HTML where it all happens, the DIV with the class Template is my template. Then the actual results get put into the DIV with the class Results.

<div id="SharepointDocumentSearch" style="display:none;">
    <p>
        Document Search Results
    </p>
    <div class="Results">
        <i>Searching...</i>
    </div>
    <div class="Template" style="display:none;">
        {#foreach $T as document}
            <div>
                <a href="{$T.document.Url}" >{$T.document.Title}</a>
            </div>
        {#/for}
    </div>
</div>

I use jQuery to make an AJAX call, get the data back then run the following code:

$("#SharepointDocumentSearch>.Results").setTemplate($("#SharepointDocumentSearch>.Template").html());
$("#SharepointDocumentSearch>.Results").processTemplate(data.d);

Although the AJAX call is successful and the results are shown in the template, the URL doesn't get resolved by the templating engine. So the HTML renders is as follows:

<div class="Results">                                                    
    <div>                                
        <a href="%7B$T.document.Url%7D">Example 1.doc</a>                            
    </div>                                                   
    <div>                                
        <a href="%7B$T.document.Url%7D">Mercury documents</a>                            
    </div>                                            
</div>

The strange thing is, if I change the template so that it's putting the Url value instead a different attribute like 'Dog' for example, it'll appear in the HTML. It's just when I use it with the Url attribute this happens.

A: 

Bug

Code doesn't run correctly in IETester IE6 instance, but works correctly on real IE6.

Peter Bridger