[英]How can I change html code of a page from another page?
At page index.htm, I have this list: 在页面index.htm上,我有以下列表:
<ul id="topic">
<li id="1">Thing1.</li>
<li id="2">Thing2.</li>
</ul>
I'd like to add and remove li itens from other page (painel.htm): 我想从其他页面(painel.htm)添加和删除链接:
At page painel.htm I'll have a input-text where the user writes the li container (thing1, 2, 3...) and a button to add or remove (currently in javascript-jquery). 在painel.htm页面上,我将有一个输入文本,用户在其中输入li容器(thing1、2、3 ...)和一个添加或删除按钮(当前在javascript-jquery中)。
I'd like to know the process that gives the information from the painel to the index. 我想知道将信息从痛苦中带到索引的过程。
At last case, I can make these pages asp using c#. 在最后一种情况下,我可以使用c#将这些页面制成asp。
Generate navs through js!
<script>
/* 2 pages nav or define your own */
var pages = [ [ {id:'1',title:'Thing1'} , {id:'2',title:'Thing2'} ] ,
[ {id:'3',title:'Thing3'} , {id:'4',title:'Thing4'} ]
];
/* set current page through asp.net or php like currentPage =0 for index.html and currentPage =1 for painel.htm */
var currentPage = 0;
function renderNavs()
{
var data = pages[currentPage];
for(var i=0; i<data.length ; i++)
{
$('#topic').append('<li id="'+data[i].id+'">' + data[i].title + '</li>');
');
}
}
$('#topic').empty();
renderNavs();
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.