PDA

View Full Version : [SOLVED]Xtemplate Error with IE 7.0



karimchebani
14 Sep 2010, 6:24 AM
Hi,

I Have a problem with Xtemplate under IE 7.0, and all my investigations to found why didnt match any result.

Here is my code :



var tpl_toolcontact= new Ext.XTemplate(
'<div id="toolbc"><br />',
'<p class="fullname">{f_name}&nbsp;&nbsp;{l_name}</p><br>',
'<tpl if="values.function && values.function.length &gt; 0">',
'<p class="function">{function}</p><br />',
'</tpl>',
'<br />',
'</div>'
);


Under Firefox, everything is fine. But When Trying it in Internet Exporer (7.0) it throws the following Error : "identifier expected (line 8674)(ext-all-debug.js).

Someone has any Idea how to fix this ?

Thanks.

Condor
14 Sep 2010, 6:40 AM
'function' is a reserved word in javascript.

You will have to use:

var tpl_toolcontact= new Ext.XTemplate(
'<div id="toolbc"><br />',
'<p class="fullname">{f_name}&nbsp;&nbsp;{l_name}</p><br>',
'<tpl if="values[''function''] && values[''function''].length &gt; 0">',
'<p class="function">{[values[''function'']}</p><br />',
'</tpl>',
'<br />',
'</div>'
);

karimchebani
14 Sep 2010, 6:43 AM
Thanks a lot Condor, I didnt notice it :x