duanhe6799 2017-03-29 09:23
浏览 94
已采纳

单击按钮时不显示对话框

I have a site which has the button 'Currency Converter'. When clicked on it, it should open the dialog box and conversion should happen. Following is the code:

currency_converter.php

<!DOCTYPE HTML>
    <html>
    <head>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="all" />
    
        <script>
            $(document).ready(function() {
                $('#openwindow').each(function() {
                    var $link = $(this);
                    var $dialog = $('<div></div>')
                        .load($link.attr('href'))
                        .dialog({
                            autoOpen: false,
                            title: $link.attr('title'),
                            width: 500,
                            height: 300
                        });
    
                    $link.click(function() {
                        $dialog.dialog('open');
    
                        return false;
                    });
                });
            });
        </script>
    
        <script type="text/javascript">
            $(document).ready(function() {
    
                $('#wrapper').dialog({
                    autoOpen: false,
                    title: 'Basic Dialog'
                });
                $('#opener').click(function() {
                    var page = "https://www.google.com/finance/converter";
    
                    var $dialog = $('<div></div>')
                        .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
                        .dialog({
                            autoOpen: false,
                            modal: true,
                            height: 250,
                            width: 350,
                            title: "Currency Converter"
                        });
                    $dialog.dialog('open');
                    return false;   
                });
            });
        </script>
    </head>
    <body>
    
    <button id="opener">Currency Converter</button>
    <div id="wrapper">
    
    </div>
    </body>
    </html>

The problem is: dialog box is not getting opened in my browser.

Can anyone please help. Thanks in advance

</div>
  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择