2012-04-30 41 views
0

我想取值id從鏈路因爲它不會改變:我想取值從網址與jQuery

<?php $se = mysql_query("select * from tee") or die(mysql_error()); 

while($row = mysql_fetch_object($se)){ 
echo'<a class="link" href="?id=" class="big-link" data-reveal-id="m'.$row->id.'"> 
    '.$row->id.' 
</a>'; }     
?> 

<?php 

$se1 = mysql_query("select * from tee") or die(mysql_error()); 
while($row1 = mysql_fetch_object($se1)) { 
    echo '<div id="m'.$row1->id.'" class="reveal-modal"> 
    <h1>Reveal Modal Goodness</h1> 
    <p>This is a default modal in all its glory, but any of the styles here can easily be changed in the CSS.</p> 
    <a class="close-reveal-modal">&#215;</a> 
</div> 
';}?> 

第一個div是出現數與第二個div燈箱內容

我想採取從鏈接值id因爲它不會改變

+0

請編輯我的代碼,因爲我不明白ajax – choppermio

+0

我不完全確定你想要什麼,但我想你想要一個/ URL獲取參數,這會讓你開始:http://papermashup.com /讀取URL,獲取變量,withjavascript / – elbekay

回答

0

如果你想獲得的HTML數據屬性值,可以使用以下命令:

$("a.big-link").data("reveal-id")