Good day, dear coders. I want to ask how to transfer $ variable -> to file.js from a .php file. And what would she put on the page, as in the case of the code in <?php echo $a;?> . After all, php code is ignored in the file with the extension * .js, and changing the extension is not an option ((. I can give the code of the .js file
function share42(f,u,t,m1,m2){if(!u)u=location.href;if(!t)t=document.title;u=encodeURIComponent(u);t=encodeURIComponent(t);if(!m1)m1=150;if(!m2)m2=20;document.write('<span id="share42">');var s=new Array('"" onclick="return fav(this);" title="Сохранить в избранное браузера"','"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl='+u+'&title='+t+'" title="Добавить в Одноклассники"','"#" onclick="window.open(\'http://vkontakte.ru/share.php?url='+u+'\', \'_blank\', \'scrollbars=0, resizable=1, menubar=0, left=200, top=200, width=554, height=421, toolbar=0, status=0\');return false" title="Поделиться В Контакте"','"http://connect.mail.ru/share?url='+u+'&title='+t+'" title="Поделиться в Моем Мире@Mail.Ru"','"http://www.facebook.com/sharer.php?u='+u+'&t='+t+'" title="Поделиться в Facebook"','"http://twitter.com/share?text='+t+'&url='+u+'" title="Добавить в Twitter"','"http://www.livejournal.com/update.bml?event='+u+'&subject='+t+'" title="Опубликовать в LiveJournal"','"http://www.linkedin.com/shareArticle?mini=true&url='+u+'&title='+t+'" title="Добавить в Linkedin"','"http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+u+'&title='+t+'" title="Сохранить закладку в Google"','"#" onclick="print();return false" title="Распечатать"','"#" onclick="return up()" title="Наверх"');for(i=0;i<s.length;i++)document.write('<a rel="nofollow" style="display:block;width:32px;height:32px;margin:0 0 6px;outline:none;background:url('+f+'icons.png) -'+32*i+'px 0" href='+s[i]+' target="_blank"></a>');document.write('</span>'); window.onload=function(){var p=document.getElementById('share42');function m(){var top=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(top+m2<m1){p.style.top=m1-top+'px';}else{p.style.top=m2+'px';}}m();window.onscroll=m;}}function fav(a){title=document.title;url=document.location;try{window.external.AddFavorite(url,title);}catch(e){try{window.sidebar.addPanel(title,url,"");}catch(e){if(typeof(opera)=="object"){a.rel="sidebar";a.title=title;a.url=url;return true;}else{alert('Нажмите Ctrl-D, чтобы добавить страницу в закладки');}}}return false;};var t;function up(){var top=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(top>0){window.scrollBy(0,-200);t=setTimeout('up()',20);}else clearTimeout(t);return false;}; Where the moment is at the very beginning title= " Save to browser favorites ", it is in place of " Save to browser favorites " that you need to insert that variable from the php file. Better yet, insert the value of the abbreviated code right away by an example.
<?php echo lang('menu_main');?> Thanks in advance for your reply!