2011-07-30 74 views
2

我使用'Colorbox'(http://colorpowered.com/colorbox/)jQuery插件來顯示模式窗口。模態窗口之一是登錄窗口。它將外部登錄頁面加載到模態窗口中。登錄模式窗口後刷新/更新主頁面

問題是當我在模態窗口中輸入我的憑證並登錄時,它在窗口內正確登錄。但是,當我關閉窗口時,主頁面(包含到登錄模式窗口的鏈接)仍顯示陳舊的「未登錄」狀態。我需要刷新整個頁面以查看「登錄」狀態。

如何在我登錄並關閉登錄模式窗口後立即更新主頁面。

回答

1

存在這樣下面的顏色框中onclosed功能,您可以在使用上onClosed功能window.load功能

$(".example9").colorbox({ 
       onOpen:function(){ alert('onOpen: colorbox is about to open'); }, 
       onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, 
       onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, 
       onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, 
       onClosed:function(){ alert('onClosed: colorbox has completely closed'); } 
      }); 
+0

您可以使用Onclosed刷新功能,例如上面用警告框 – devtut

+0

對此我是新手,你能告訴我重寫命令在這裏寫嗎? :( –

+0

我的意思是刷新命令 –