如何解决Uncaught TypeError:window.showModalDialog不是一个函数 [英] how to resolve Uncaught TypeError: window.showModalDialog is not a function

查看:926
本文介绍了如何解决Uncaught TypeError:window.showModalDialog不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Window.showmodaldialog正在打开但是没有打开chrome。如何使用chrome也。为此帮助我。我使用的代码如下。



代码: -

hi to all,
Window.showmodaldialog is opening in ie but no open in chrome . how to work with chrome also.kindly help me for this. below code i used.

code:-

function PrintItem(ID, BID) {
         
           window.showModalDialog('./ProductSalesBill.aspx?Req=N&SID=' + ID + '&BID=' + BID, self, 'dialogWidth:800px;dialogHeight:530px;status:no;dialogHide:yes;unadorned:no;');
       }





这里我打电话给这样的打印项目: -

a href ='< ;%#String.Format(javascript:PrintItem({0},'{1}'),Eval(Billno),Eval(BranchCode))%>



以上href标签位于网格视图中。



here i call this print item like this:-
a href='<%#String.Format("javascript:PrintItem({0}, '{1}')", Eval("Billno"), Eval("BranchCode")) %>

above href tag is in grid view.

推荐答案

不推荐使用。请参阅我之前的回答 - 'window.ShowModalDialog'无法在Chrome中使用 [ ^ ]。
It is deprecated. Please see my previous answer - ' window.ShowModalDialog ' not working in Chrome[^].


您在浏览器中的对象窗口中没有此函数类型属性使用。此功能已弃用且正在进行中。请参阅: https://developer.mozilla.org/en-US/docs/Web / API / Window / showModalDialog [ ^ ]。



不要使用此功能。有许多更好的替代方法,例如jQuery对话框:

https://jqueryui.com/dialog [ ^ ]。



请注意,这样的对话框(有更多的组件,如统称为模态弹出窗口,具有不同的功能,如视觉效果,过渡等)不显示真实弹出窗口,但在同一页面上模仿模态行为,这要好得多。



-SA
You just don't have this function-type property in the object window in the browser you are using. This feature is deprecated and is going. Please see: https://developer.mozilla.org/en-US/docs/Web/API/Window/showModalDialog[^].

Don't use this function. There are many way better alternatives, such as jQuery dialog:
https://jqueryui.com/dialog[^].

Note that such dialogs (there are many more components like that collectively known "modal popup", with different features, such as visual effects, transitions, etc.) doesn't show "real" popup, but mimic modal behavior on the same page, which is much better.

—SA


这篇关于如何解决Uncaught TypeError:window.showModalDialog不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆