I have a file auto generating named tmp/yes which have text inside. I also have created a new tab in a template form with the file name yyy.htm.
But i cant show the text file on the web page, I am currently using the following code, but its not working for me,
is intended for plugins, so having it to include a text file might not work on some browser. I tested it on a Windows 10 PC; it worked on Chrome, Fire Fox, Opera, but not on Edge or IE.
seems to work on IE after Active X warning but didn't work on Edge, like the following
<head>
</head>
<body>
bla bla bla
<embed src = "tmp/emb" width = "100%" height = "60" >
<object width="1000" height="200" data="tmp/emb2"></object>
</body>
So, generally speaking, to include some text file in an HTML you should probably use JavaScript or some scripting language.
I don't know, to be honest. I never looked at the source code before (shame on me) . All I have is the binary on my router. I was only talking about HTML in general.
I recommend you try it with a simple HTML file like mine, and see if it works on your browser before you try to use it with LuCI.
I don't know where are you putting the code. Is it in the part you shared? (Sorry, I have no clue how lua file is supposed to look. I am confused what's "tmp/yes" and what's yyy.htm", and if the "yes" in the function index has anything to do with them.
If you share what you have I could try to figure out what's wrong.
so the lua file which have that module and function goes at usr/lib/lua/luci/controller/admin/yes.lua and yeah it is the code that i asked you as a reply.
and in that file luci.controller.admin.yes is the location so, luci/controller/admin/yes.lua
in function admin.yes means admin/yes URL.
the template("yyy") is the name of the .htm file which will be shown at admin/yes/tab_one URL and it is being stored at ..../luci/view/yyy.htm and i have put the code of yyy.htm in the question.
and the name of the tab will be YES and the 1st subtab will be kamnu
and the tmp/yes is yes file without any extension which I am trying to show at the subtab named kamnu or say at the URL 192.168.1.1_..._._admin/yes/tab_one