2016-05-18 34 views
0

有人可以告诉我为什么我的表行href链接被删除时,我添加我的JQuery脚本。我将该网址添加到了html中,但是当我添加该脚本时,网址被删除了。下面是我的表码:我的href链接被删除,由于jQuery脚本

<table border="0"> 
      <tbody> 
       <tr class="header"> 
       <td>Header</td> 
       </tr> 
       <tr> 
       <td><a href="http://www.google.com">Data Row 1 Goes Here...</a></td> 
       </tr> 
       <tr> 
       <td>Data Row 2 Goes Here...</td> 
       </tr> 
       <tr class="header"> 
       <td>Header</td> 
       </tr> 
       <tr> 
       <td>Data Row 1 Goes Here...</td> 
       </tr> 
     </tbody> 
    </table> 

回答

0

这里是我的脚本:

<script> 
    window.jQuery || document.write('<script src="//code.jquery.com/jquery-1.9.1.min.js">\x3C/script>'); 
</script> 

<script language="javascript"> 

_spBodyOnLoadFunctionNames.push("HideBrandingsuite"); 

function HideBrandingsuite() 

{ 

document.getElementById('pageTitle').style.visibility = 'hidden'; 

} 
$('tr.header').click(function(){ 
    $(this).nextUntil('tr.header').css('display', function(i,v){ 
     return this.style.display === 'table-row' ? 'none' : 'table-row'; 
    }); 
}); 
</script>