Помогите решить проблему, подключил к странице скрипт share42.js, все вроде бы хорошо, видно, но далее html страницы подключаются через ajax и скрипт share42 не хочет работать не под каким видом, может кто ни будь свежим взглядом найдет причину? то все работает кроме него.
Подключено так, в headere:
Код: Выделить всё
<script>
function showContent(link) {
var cont = document.getElementById('contentBody');
var loading = document.getElementById('loading');
cont.innerHTML = loading.innerHTML;
var http = createRequestObject();
if( http ) {
http.open('get', link);
http.onreadystatechange = function () {
if(http.readyState == 4) {
cont.innerHTML = http.responseText;
}
}
http.send(null);
} else {
document.location = link;
}
}
function createRequestObject() {
try { return new XMLHttpRequest() }
catch(e) {
try { return new ActiveXObject('Msxml2.XMLHTTP') }
catch(e) {
try { return new ActiveXObject('Microsoft.XMLHTTP') }
catch(e) { return null; }
}
}
}
</script>
Запуск
Код: Выделить всё
<form>
<input class="hasText btn rounded Button boardFollowUnfollowButton primary Module BoardFollowButton notNavigatable ui-FollowButton" onclick="showContent('{U_PEOPLES_0}')" type="button" value="1">
<input class="hasText btn rounded Button boardFollowUnfollowButton primary Module BoardFollowButton notNavigatable ui-FollowButton" onclick="showContent('{U_PEOPLES_1}')" type="button" value="2">
и так далее...
</form>
php файл
Код: Выделить всё
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$template->assign_vars(array(
'USER_AVATAR' =>($user->optionget('viewavatars') && function_exists('get_user_avatar')) ? get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']) : '',
'ONLINE_IMG_AVATAR' => $user->img('icon_user_online', 'ONLINE'),
'U_PEOPLES_0' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples0'),
'U_PEOPLES_1' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples1'),
'U_PEOPLES_2' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples2'),
'U_PEOPLES_3' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples3'),
'U_PEOPLES_4' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples4'),
'U_PEOPLES_5' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples5'),
'U_PEOPLES_6' => append_sid("{$phpbb_root_path}peoples.$phpEx", 'page=peoples6'),
));
// Output page
page_header($user->lang['TITLE']);
$cond=request_var('page', '');
switch($cond)
{
case 'peoples':
$template->set_filenames(array(
'body' => 'peoples/index_peoples.html' ));
break;
case 'peoples0':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_0pg.html' ));
break;
case 'peoples1':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_1pg.html' ));
break;
case 'peoples2':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_2pg.html' ));
break;
case 'peoples3':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_3pg.html' ));
break;
case 'peoples4':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_4pg.html' ));
break;
case 'peoples5':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_5pg.html' ));
break;
case 'peoples6':
$template->set_filenames(array(
'body' => 'peoples/index_peoples_6pg.html' ));
break;
}
page_footer();
?>