1

请原谅我的愚蠢问题,但我是 javascript 的菜鸟,只是好奇。

我有一个插入了 fancybox 的本地 html 文件,该文件在本地工作得很好,但前提是建立了互联网连接。所以我想知道为什么?

脚本是否发送某种请求?如果是这样,到哪个服务器?

这是代码(它显示模态窗口):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>title</title>
    <link href="css/main.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/fancybox.css" rel="stylesheet" type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
    <script type="text/javascript" src="js/fancybox.js"></script>
    <script type="text/javascript" src="js/fancybox.pack.js"></script>
    <script type="text/javascript" src="js/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="js/jScrollPane.js"></script>
    <script type="text/javascript" src="js/cusel.js"></script>
    <script type="text/javascript" src="js/fns.js"></script>


 </head>
    <body>
    <!-- This one triggers modal window -->
        <div class="order_call"><a href="#popup1" class="pseudolink popup_link"><span    class="order_call_icon"></span>Order</a></div>




<!-- and this one is window itself -->  


<div class="popup_reduser">
                        <h2 class="border">Обратный звонок<span class="popup_close">ЗАКРЫТЬ<em></em></span></h2>
                        <form action="" id="feedback">
                            <table class="form_table">
                                <tr>
                                    <td class="label_td">
                                        <label for="popup_tel_num" class="label">Номер телефона: <span>*</span></label>
                                    </td>
                                    <td><input type="text" id="popup_tel_num" class="input" /></td>
                                </tr>
                                <tr>
                                    <td class="label_td"><label for="name"  class="label">Имя:</label></td>
                                    <td><input type="text" id="name" class="input" /></td>
                                </tr>
                                <tr>
                                    <td class="label_td">Позвоните мне:</td>
                                    <td>
                                        <input type="radio" id="feedback1" class="radio" name="radio" />
                                        <label for="feedback1" class="radio_label">прямо сейчас</label>
                                    </td>
                                </tr>
                                <tr class="tr_last">
                                    <td class="label_td">&nbsp;</td>
                                    <td class="time_select">
                                        <input type="radio" id="feedback2" class="radio" name="radio" />
                                        <span class="txt">с</span>
                                        <div class="short">
                                            <select name="" id="select10" class="">
                                                <option value="">10:00</option>
                                                <option value="">11:00</option>
                                                <option value="">12:00</option>
                                            </select>
                                        </div>
                                        <span class="txt">до</span>
                                        <div class="short">
                                            <select name="" id="select11" class="">
                                                <option value="">10:00</option>
                                                <option value="">11:00</option>
                                                <option value="">12:00</option>
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div class="submit"><input type="submit" value="Заказать" /></div>
                            <div class="reset"><input type="reset" value="Отменить" /></div>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>    




        </body>
        </html>

感谢大家!

4

1 回答 1

2
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>

因为您引用的是 Google 的 CDN,所以您需要 Internet 连接来调用 jQuery 和 jQuery UI 库。下载文件并将其保存在本地并像这样调用路径。

例子:

 <script type="text/javascript" src="PATH/jquery.min.js"></script>
 <script type="text/javascript" src="PATH/jquery-ui.min.js"></script>
于 2012-11-27T18:38:19.983 回答