kastembay
Постоялец
- Регистрация
- 3 Янв 2013
- Сообщения
- 208
- Реакции
- 124
- Автор темы
- #1
Доброго времени суток. Ни с того, ни с сего выскочила ошибка такого характера "Uncaught TypeError: Cannot read property '1' of null"
Вот код
Отдельная строка.
Я уже туплю и не могу сообразить почему так?
Вот код
Код:
plugin.getTabs = function() {
var $matchingPanel;
// Find the initial set of elements matching the setting.tabs
// CSS selector within the container
plugin.tabs = $container.find(settings.tabs),
// Instantiate panels as empty jquery object
plugin.panels = $(),
plugin.tabs.each(function(){
var $tab = $(this),
$a = $tab.children('a'),
// targetId is the ID of the panel, which is either the
// `href` attribute for non-ajax tabs, or in the
// `data-target` attribute for ajax tabs since the `href` is
// the ajax URL
targetId = $tab.children('a').data('target');
$tab.data('easytabs', {});
// If the tab has a `data-target` attribute, and is thus an ajax tab
if ( targetId !== undefined && targetId !== null ) {
$tab.data('easytabs').ajax = $a.attr('href');
} else {
targetId = $a.attr('href');
}
targetId = targetId.match(/#([^\?]+)/)[1]; - вот это строка
$matchingPanel = settings.panelContext.find("#" + targetId);
// If tab has a matching panel, add it to panels
if ( $matchingPanel.length ) {
// Store panel height before hiding
$matchingPanel.data('easytabs', {
position: $matchingPanel.css('position'),
visibility: $matchingPanel.css('visibility')
});
// Don't hide panel if it's active (allows `getTabs` to be called manually to re-instantiate tab collection)
$matchingPanel.not(settings.panelActiveClass).hide();
plugin.panels = plugin.panels.add($matchingPanel);
$tab.data('easytabs').panel = $matchingPanel;
// Otherwise, remove tab from tabs collection
} else {
plugin.tabs = plugin.tabs.not($tab);
if ('console' in window) {
console.warn('Warning: tab without matching panel for selector \'#' + targetId +'\' removed from set');
}
}
});
};
Отдельная строка.
Код:
targetId = targetId.match(/#([^\?]+)/)[1];