Вроде все сделал правильно:
main.js
Код: Выделить всё
$(document).ready(function() { VK.init(function() { VK.callMethod("setLocation",thisLocation); VK.addCallback("onLocationChanged",onLocationChanged); setInterval(resizeContent,500); resizeContent(); VK.callMethod("setTitle",document.title); }); }); function resizeContent(){ var real_height = document.getElementById('page').clientHeight; VK.callMethod('resizeWindow',740,real_height+20);} function onLocationChanged(param) { if(thisLocation!=param){ window.location='http://mysite.ru/'+param; exit; }}
Код: Выделить всё
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{Flash} - <?php echo $id; ?></title> <link rel="stylesheet" href="/css/global.css" type="text/css" /> <script type="text/javascript" src="http://userapi.com/js/api/openapi.js?17"></script> <script src="http://vkontakte.ru/js/api/xd_connection.js?2" type="text/javascript"></script> <script type="text/javascript" src="http://vkontakte.ru/js/api/share.js?10" charset="windows-1251"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="/js/main.js"></script> <script type="text/javascript"> var thisLocation = '<?php echo $id; ?>'; </script> </head>