Cannot read property 'callbackdata' of undefined

寫了個layer.open,想從子頁面返回數據到前臺,然後找了找百度,全是這樣的複製粘貼的文章:

獲取layer.open彈出層的返回值

裏面用的是

 var res = window["layui-layer-iframe" + index].callbackdata();

然而卻是報錯Cannot read property 'callbackdata' of undefined

這篇文章裏面說,在window前面加個

parent.

但也沒卵用

最後找到這篇文章,(layer) 如何關閉子頁面之後把數據回顯到父頁面上?

裏面說的方法是

var res = $(layero).find("iframe")[0].contentWindow.callbackdata();

然後就好了。。。。。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章