If i use script tag display nothing was display and without script tag displayed code in text format
Can anyone tell me how to use this api new method
-
- Posts: 38
- Joined: Tue Mar 07, 2023 7:13 pm
- Contact:
Re: Can anyone tell me how to use this api new method
This is weird, I don't know what the problem could beshrmaprem0202 wrote: βMon Feb 05, 2024 3:23 am If i use script tag display nothing was display and without script tag displayed code in text format
-
- Posts: 38
- Joined: Tue Mar 07, 2023 7:13 pm
- Contact:
Re: Can anyone tell me how to use this api new method
francisco wrote: βMon Feb 05, 2024 3:25 amThis is weird, I don't know what the problem could beshrmaprem0202 wrote: βMon Feb 05, 2024 3:23 am If i use script tag display nothing was display and without script tag displayed code in text format
Code: Select all
<script>
local tags = [=[
<div class="user-line">
<a href="/user/%id%/%username%"><b>%username%</b></a><br>
<i>Registered: %regdate%</i>
</div>
]=]
local param = {
limit = 10,
order = "id_desc"
}
local is_ok, list = api.user_info(param)
if is_ok then
print('\n<div class="user-list">\n')
print(html.render_tag(tags, list, true))
print('\n</div>\n')
end
</script>
Re: Can anyone tell me how to use this api new method
Do not use <script> and </script>, this is Lua code, not Javascript.
-
- Posts: 38
- Joined: Tue Mar 07, 2023 7:13 pm
- Contact:
Re: Can anyone tell me how to use this api new method
I removed script tag and put this code in tag code then this result was show
local tags = [=[
%username%
Registered: %regdate%
]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n
\n') print(html.render_tag(tags, list, true)) print('\n
\n') end
Re: Can anyone tell me how to use this api new method
Code: Select all
local tags = [=[ %username% Registered: %regdate% <br> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
Re: Can anyone tell me how to use this api new method
Code: Select all
local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
Re: Can anyone tell me how to use this api new method
Super, thank youXkria-uy wrote: βMon Feb 05, 2024 9:30 pmCode: Select all
local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
Screenshot_20240205-182739.png
-
- Posts: 38
- Joined: Tue Mar 07, 2023 7:13 pm
- Contact:
Re: Can anyone tell me how to use this api new method
Where you put this codevikkas wrote: βTue Feb 06, 2024 2:06 amSuper, thank youXkria-uy wrote: βMon Feb 05, 2024 9:30 pmCode: Select all
local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
Screenshot_20240205-182739.png
-
- Posts: 38
- Joined: Tue Mar 07, 2023 7:13 pm
- Contact: