01-20-2021, 07:42 PM
Hello in my application, i am using a template file to with th IWTemplateProcessorHTML1 component.
In this template i have a little Javascript to know the type of device ( iphone, PC ....etc)
when i open th Html file inChrom ,it is ok the test is ok and my variables are appaering in Chrome.
But in my application nothin , the application is launching but nothing ara display en the screen.
We can't make java script in a template.
So, if it is my problem, how can i do to make javascript in my program, where , and how can i retrieve the result of the javascript in a delphi variable
this is my template
<html>
<head>
<title></title>
</head>
<body>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
if( navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
document.write(' <div align="center">');
document.write(' Vente à distance<br/>');
document.write('Merci de vous loguer <br/>');
document.write('<br/>');
document.write('{%iwlabel1%} {%user%} <br/>');
document.write('<br/>');
document.write('{%iwlabel2%} {%mdp%}<br/>');
document.write('<br/>');
document.write('{%valider%} <br/>');
document.write('<br/>');
document.write('{%iwlabel5%}<br/>');
document.write('{%iwlabel6%}<br/>');
document.write('{%iwlabel4%} {%nmdp1%}<br/>');
document.write('<br/>');
document.write('{%iwlabel3%} {%nmdp2%}<br/>');
document.write('{%changermdp%} <br/>');
document.write('{%iwimage2%}<br/>');
document.write('{%iwimage1%}<br/>');
document.write('{%iwlabel9%}<br/>');
document.write('</div>');
}
else {
document.write('<div align="center">')
document.write(' IPHONE{%iwlabel7%}<br/>')
document.write('{%iwlabel8%}<br/>')
document.write('<br/>')
document.write('{%iwlabel1%} {%user%} <br/>')
document.write(' {%valider%} <br/>')
document.write(' {%iwlabel2%} {%mdp%} {%iwimage4%}<br/>  <br/>')
document.write('<br/>')
document.write('<br/>')
document.write('{%iwlabel5%}<br/>')
document.write('{%iwlabel6%}<br/>')
document.write('<br/>')
document.write(' {%iwlabel4%} {%nmdp1%} {%iwimage5%} <br/>')
document.write(' {%changermdp%} <br/>')
document.write(' {%iwlabel3%} {%nmdp2%} {%iwimage6%}<br/>')
document.write('{%iwimage2%}<br/>')
document.write('{%iwimage3%} {%iwimage1%}{%iwimCR%}{%iwLCR%}<br/>')
document.write('{%iwlabel9%}<br/>')
document.write('{%iwlabel10%}<br/>')
document.write('{%iwbutton1%}<br/>')
document.write('<br/>')
document.write(' {%chadmin%} {%mdpad%} {%btnad%} <br/>')
document.write('</div>');
}
</SCRIPT
</body>
</html>
Thank's
In this template i have a little Javascript to know the type of device ( iphone, PC ....etc)
when i open th Html file inChrom ,it is ok the test is ok and my variables are appaering in Chrome.
But in my application nothin , the application is launching but nothing ara display en the screen.
We can't make java script in a template.
So, if it is my problem, how can i do to make javascript in my program, where , and how can i retrieve the result of the javascript in a delphi variable
this is my template
<html>
<head>
<title></title>
</head>
<body>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
if( navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
document.write(' <div align="center">');
document.write(' Vente à distance<br/>');
document.write('Merci de vous loguer <br/>');
document.write('<br/>');
document.write('{%iwlabel1%} {%user%} <br/>');
document.write('<br/>');
document.write('{%iwlabel2%} {%mdp%}<br/>');
document.write('<br/>');
document.write('{%valider%} <br/>');
document.write('<br/>');
document.write('{%iwlabel5%}<br/>');
document.write('{%iwlabel6%}<br/>');
document.write('{%iwlabel4%} {%nmdp1%}<br/>');
document.write('<br/>');
document.write('{%iwlabel3%} {%nmdp2%}<br/>');
document.write('{%changermdp%} <br/>');
document.write('{%iwimage2%}<br/>');
document.write('{%iwimage1%}<br/>');
document.write('{%iwlabel9%}<br/>');
document.write('</div>');
}
else {
document.write('<div align="center">')
document.write(' IPHONE{%iwlabel7%}<br/>')
document.write('{%iwlabel8%}<br/>')
document.write('<br/>')
document.write('{%iwlabel1%} {%user%} <br/>')
document.write(' {%valider%} <br/>')
document.write(' {%iwlabel2%} {%mdp%} {%iwimage4%}<br/>  <br/>')
document.write('<br/>')
document.write('<br/>')
document.write('{%iwlabel5%}<br/>')
document.write('{%iwlabel6%}<br/>')
document.write('<br/>')
document.write(' {%iwlabel4%} {%nmdp1%} {%iwimage5%} <br/>')
document.write(' {%changermdp%} <br/>')
document.write(' {%iwlabel3%} {%nmdp2%} {%iwimage6%}<br/>')
document.write('{%iwimage2%}<br/>')
document.write('{%iwimage3%} {%iwimage1%}{%iwimCR%}{%iwLCR%}<br/>')
document.write('{%iwlabel9%}<br/>')
document.write('{%iwlabel10%}<br/>')
document.write('{%iwbutton1%}<br/>')
document.write('<br/>')
document.write(' {%chadmin%} {%mdpad%} {%btnad%} <br/>')
document.write('</div>');
}
</SCRIPT
</body>
</html>
Thank's