html 联动返回页面,常规页面联动.html

常规页面联动

由于为了保持项目的轻便性,不参与业务逻辑,仅对表单部分做了简单的事件处理,其他部分的事件处理需要自己编写

动态绑定。需要注意reset问题,以及表单验证


表单提交绑定

var session={};

$(function(){

var data={

data:[

{

title:"Alice in Wonderland",

desc:"Alice's Adventures in Wonderland (commonly shortened to Alice in Wonderland) is an 1865 novel written by English author Charles Lutwidge Dodgson under the pseudonym Lewis Carroll.[1] It tells of a girl named Alice who falls down a rabbit hole into a fantasy world populated by peculiar, anthropomorphic creatures. The tale plays with logic, giving the story lasting popularity with adults as well as with children.[2] It is considered to be one of the best examples of the literary nonsense genre.[2][3] Its narrative course and structure, characters and imagery have been enormously influential[3] in both popular culture and literature, especially in the fantasy genre.",

price:15

},

{

title:"Bridge to Terabithia ",

desc:"Bridge to Terabithia is a work of children's literature about two lonely children who create a magical forest kingdom. It was written by Katherine Paterson and was published in 1977 by Thomas Crowell. In 1978, it won the Newbery Medal. Paterson drew inspiration for the novel from a real event that occurred in August 1974 when a friend of her son was struck by lightning and killed.",

price:16

},

{

title:"Die Leiden des jungen Werthers",

desc:"The Sorrows of Young Werther (German: Die Leiden des jungen Werthers) is an epistolary and loosely autobiographical novel by Johann Wolfgang von Goethe, first published in 1774; a revised edition of the novel was published in 1787. Werther was an important novel of the Sturm und Drang period in German literature, and influenced the later Romantic literary movement.",

price:20

},

{

title:"The Count of Monte Cristo",

desc:"The Count of Monte Cristo (French: Le Comte de Monte-Cristo) is an adventure novel by French author Alexandre Dumas (père) completed in 1844. It is one of the author's most popular works, along with The Three Musketeers. Like many of his novels, it is expanded from plot outlines suggested by his collaborating ghostwriter Auguste Maquet.[1]",

price:17

}

]

}

jc.render(data,"pageDuplex",$("#leftPanel"),function(th){

jc.render(th.data().data[0],"pageDuplex1",$("#rightPanel"));

$("#leftPanel").find("li").click(function(e){

var elemData= th.data().data[e.currentTarget.getAttribute("path")]

jc.render(elemData,"pageDuplex1",$("#rightPanel"),function(t){

})

})

})

var data1 = jc.mix(true,{},data)

function renderRightPanel1(data,index){

jc.render(data,"pageDuplex1",$("#rightPanel1"),function(t){

$("#rightPanel1").find('form').submit(function(e){

e.preventDefault();

//做业务逻辑,例如传递给服务器

//如果成功...

jc.mix(true,jc.th($("#leftPanel1")).data().data[index],data)//更改数据

return false;

})

})

}

jc.render(data1,"pageDuplex",$("#leftPanel1"),function(th){

$("#leftPanel1").find("li").click(function(e){

var index = e.currentTarget.getAttribute("path");

var elemData= th.data().data[index]

elemData = jc.mix(true,{},elemData)

renderRightPanel1(elemData,index)

})

renderRightPanel1(jc.mix(true,{},th.data().data[0]),0)

})

})

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值