Код: Выделить всё
<script type="text/javascript" charset="utf8" > window.onload = (function() { var viewer_id = 0; var auth_key = 0; var uidmy = 0; var myfriend = <?php echo $_GET['id'];?>; VK.init(function() { var parts=document.location.search.substr(1).split("&"); var flashVars={}, curr; for (i=0; i<parts.length; i++) { curr = parts[i].split('='); flashVars[curr[0]] = curr[1]; } viewer_id = flashVars['viewer_id']; auth_key = flashVars['auth_key']; VK.api("users.get", {uids:myfriend,fields:"photo_big"}, function(data) { document.getElementById('friends').innerHTML = "<img src='" + data.response[0].photo_big + "'>"; }); $("#okbtn").click(function(){ $.post('sendpresent.php',{ "viewer_id": viewer_id, "auth_key": auth_key, "present": sentpr, "idto": myfriend}, function(data){ $('#result').html(data); }); }); }); }); </script>
Подскажите, пожалуйста, почему так происходит