This is a static page.
Use Smarty loops to achieve this
{literal}
Reply to discussion (solution)
As on the Web page, it's better to change the delimiter "{<"
PHP can be converted into JSON with Json_encode and then passed to Smarty, JS parsing json output is much simpler.
{foreach Item=lop from= $tuan}
Box.add ({"url": "./upload/admin/{$lop. Image}", "title": "{$lop. Title}"});
{/foreach}
This loop can be encapsulated by PHP, and the value will be passed to the template.
{foreach Item=lop from= $tuan}
Box.add ({"url": "./upload/admin/{$lop. Image}", "title": "{$lop. Title}"});
{/foreach}
This loop can be encapsulated by PHP, and the value will be passed to the template.
This is justified. Either encapsulated by PHP, the value is passed to the template, or it is encapsulated by the JS function, and the value is passed to the template to determine if the function is executed.
PHP can be converted into JSON with Json_encode and then passed to Smarty, JS parsing json output is much simpler.
Elder brother, have not used Json_encode,json, task a little rush. Help people in the end, write some specific code, thank you!
example, you can change it by yourself.
var json= ' [{' id ': "name": "AA"},{"id": "name": "BB"}] '; JSON object from PHP json_encode var obj=eval (JSON) for (var i=0; i
The third floor method, I feel it.
example, you can change it by yourself.
var json= ' [{' id ': "name": "AA"},{"id": "name": "BB"}] '; JSON object from PHP json_encode var obj=eval (JSON) for (var i=0; i
I tried to change it in your case, trying to output the format I wanted correctly, but it was outputting the data directly on the page. JS can not read, how should I write it?
Remove the document.write
Remove the document.write
for (var i=0; i
}
So, but still no effect ah!
What exactly do you want to achieve?
for (var i=0; I
I met the same problem as the landlord ... I used a stupid method. is to use {literal}{/literal} to separate the variable and JS code. The
complete code is as follows
"!--{if $recommend _product}-->"!--{/if}-->
" Li>