子页面要获取父页面的元素,在网上我搜到很多方法我都试过,都不行。后来我看了很多标签页面的代码,发现要这么写才行。
function removePanel(){ var jq = top.jQuery; var domobj = jq("#mainTabs") var tab = domobj.tabs('getSelected'); if(tab){ var index = domobj.tabs('getTabIndex',tab); domobj.tabs('close',index); } }
要用top.jQuery.当然至于这句话是什么底层是什么意思,我也还不知道。如果你知道的话,也请在下面回复我。谢谢