-1
我想這些功能的JavaScript代碼執行時執行;如何在腳本中執行一個函數?
function check_count2($userid,$picid){
\t $sql5 = "select count(*) from abctable
\t \t \t where persona='$kuladii123' and personb='$resimid'";
\t $result5 = mysql_query($sql5);
\t $row5 = mysql_fetch_row($result5);
\t return $row5[0];
}
function myfunction($userid,$picid){
\t $test = check_count2($userid,$picid);
\t if ($test == 0){
\t \t $sql6 = "insert into abctable (persona,personb)
\t \t \t \t values ($userid,$picid)";
\t \t $result6 = mysql_query($sql6);
\t }
}
Javascript代碼;
<script type="text/javascript">
$(".photos'.$picid.'").waypoint(function() {
myfunction(); // I WANT THIS FUNCTION HERE!
}
});
</script>
我不能叫myfunction的,請幫幫我。