所以,你不想重置这些部分使用服务器端逻辑?我对么? 假设您能够检测到用户来自的页面,并且只需要重置相应的部分,以下是我的想法: -
定义函数以获取子部分(用于重置),如下所示: -
//These two functions return the ids of the divs which need to be ignored
function getApplicationPart()
{
//Assuming there are multiple sections to be reset
var sections = ["Banana", "Orange", "Apple", "Mango"];
return sections;
}
function getSubCategoryPart()
{
var sections = ["Potato", "Onion"];
return sections;
}
,并定义一个函数,将做必要的重置
function resetSections(sectionsArray)
{
$.each(sectionsArray, function(index, value) {
//reset the values of all child input tags (inputs inside the section holding div)
$("#"+value).children("input").val("");
});
//define any other hiding thing you need to do here
}
现在,你只需要相应地决定哪些部分复位并调用resetSections()函数。像这样: -
if((subcategoryPage)&&(comingfromApplicationPage))
{
resetSections(getApplicationPart());
}
希望这会有所帮助。
如果没有表格标记的完整示例,这是不可能回答的。 – 2010-12-17 10:07:31