<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.js"></script>
<script src="js/include.js"></script>
<script src="js/popup.js"></script>
</head>
<body>
<textarea id="input"></textarea><br>
<input id="btn_submit" type="submit"><br>
<div class="result"></div>
</body>
</html>
$(document).ready(function(){
$('#btn_submit').click(function(e){
e.preventDefault();
var input = $('#input').val();
$.ajax({
url: "http://sayt.ru/script.php",
type: 'GET',
data: ({url: input}),
dataType: "html",
cache: false,
success: function(data) {
var html = '<b>Нажмите (Вставить данные) для заполнения полей</b>';
$('body').append("<div id='fbPopup' class='dle-promt' title='Полученные данные' style='display:none'>"+html+"</div>");
$('#fbPopup').dialog({
autoOpen: true,
resizable: false,
width: "auto",
dialogClass: "modalfixed",
buttons: {
"Отмена": function() {
$( this ).dialog( "close" );
},
"Вставить данные": function() {
insert_data_rufbru(data.result);
$( this ).dialog( "close" );
}
}
});
$('.modalfixed.ui-dialog').css({position:"fixed"});
}
});
});
function insert_data_rufbru(data){
console.log(data);
}
});