Reputation: 1492
Please excuse me for stupid question, but I am a noob in javascript and just curious.
I have a local html file with fancybox plugged in, and this file works great locally, but only if internet connection is established. So I wonder why?
Does script send some kind of requests? And if so, to which server?
This is the code (it shows modal window):
<!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"> </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>
Thanks everyone!
Upvotes: 1
Views: 329
Reputation: 5353
<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>
Because you are referencing Google's CDN you need an internet connection to call the jQuery and jQuery UI libraries. Download the files and save it locally and call the paths like this.
Example:
<script type="text/javascript" src="PATH/jquery.min.js"></script>
<script type="text/javascript" src="PATH/jquery-ui.min.js"></script>
Upvotes: 2