2012-07-06 53 views
0

我有以下功能在Safari中無法工作的PC或MAC:jQuery的功能不工作在Safari?

var $j = jQuery.noConflict(); 

$j(document).ready(function(){ 
    $j(".wpp_search_button.submit:eq(0)").click(function(){ 
     _gaq.push(['_trackEvent', 'Search', 'Header Search', '', 1]);  
    }); 
}); 

$j(document).ready(function(){ 
    $j(".wpp_search_button.submit:eq(1)").click(function(){ 
     _gaq.push(['_trackEvent', 'Search', 'Body Search', '', 1]); 
    }); 
}); 

它應該的onclick用於追蹤我的網站搜索,但它doen't。任何建議?

+1

「不過,這並不」不構成足夠的細節,使這個問題交代。 – Bojangles 2012-07-06 22:37:44

回答

0

我的建議是嘗試綁定到的mousedown,看看是否能解決問題:

$j(".wpp_search_button.submit:eq(0)").mousedown(function(){ 
    _gaq.push(['_trackEvent', 'Search', 'Header Search', '', 1]);  
}); 

$j(".wpp_search_button.submit:eq(0)").mousedown(function(){ 
    _gaq.push(['_trackEvent', 'Search', 'Header Search', '', 1]);  
});