在Ajax响应函数之后,我收到错误“未捕获的异常:语法错误,无法识别的表达式:#”
我的代码:
var currentState = '';
function clickNavLink() {
var href = $(this).attr('href');
if (href == currentState) {
return false;
}
if (document.location.hash != href) {
document.location.hash = href;
}
var link = this;
//$(this).parent().find('.busy').show();
currentState = href;
$.ajax({
type: "POST",
url: "/ajax.php",
data: "url="+currentState,
success: function(data){
$('#container_main').html(data);
Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
Cufon.replace('.rblock h2', { fontFamily: 'Myriad' });
Cufon.replace('.right-col h2', { fontFamily: 'Myriad' });
Cufon.replace('.over-form h3', { fontFamily: 'Myriad' });
Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
}
});
return true;
}
jQuery(document).ready(function() {
$("a").live("hover", function(){
if($(this).attr('href')!='' && $(this).attr('href')!='#' && $(this).attr('href')!='javascript:;' && $(this).attr('href')[1]!='#'){
$(this).attr('href','/#'+$(this).attr('href'));
}
if($(this).attr('class')=='slevel' || $(this).attr('class')=='slevel'){
if(this.id){
$(this).click(clickNavLink);
}
}
});
$('a.flevel').each(function() { $(this).click(clickNavLink); });
$('a.slevel').each(function() { $(this).click(clickNavLink); });
var URL = document.location.toString();
if (URL.match('#')) {
var anchor = '#' + URL.split('#')[1];
$.ajax({
type: "POST",
url: "/ajax.php",
data: "url=/"+anchor,
success: function(data){
$('#container_main').html(data);
Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
}
});
}
});
编辑:
http://bradford.webgo.org.ua/#/jobs 单击作业的菜单链接之一,然后在firebag中查看错误行
错误行jquery.js(строка130) 这不是Cufon ......