我回應了一個變量,它添加了我的鏈接(輸出一個數字)並將它們加起來。由於它是PHP,它首先加載,並使我的網站等待,直到完成加載。這可以寫在jQuery?我對JavaScript很陌生。php轉換爲javascript
<?php
$a = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.batterytheme&output=number');
$a = str_replace(",", "", $a);
$b = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.connectiontheme&output=number');
$b = str_replace(",", "", $b);
$c = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.icontheme&output=number');
$c = str_replace(",", "", $c);
$d = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.percenttheme&output=number');
$d = str_replace(",", "", $d);
$e = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.statusnotifiertheme&output=number');
$e = str_replace(",", "", $e);
$f = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.cnote&output=number');
$f = str_replace(",", "", $f);
$g = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.iaccescnotekb&output=number');
$g = str_replace(",", "", $g);
$h = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.cnotelite&output=number');
$h = str_replace(",", "", $h);
$i = (301); //From c-note and Multi Lock Screen Theme on Rock Your Phone
$j = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.multibrowsericon&output=number');
$j = str_replace(",", "", $j);
$k = file_get_contents('http://modmyi.com/cstats/index.php?package=com.modmyi.changeappstoreiconwithinstallous&output=number');
$k = str_replace(",", "", $j);
$z = $a+$b+$c+$d+$e+$f+$g+$h+$i+$j+$k;
$z = number_format($z);
echo $z;
?>
可你這是什麼一樣多一點我不知道我是否理解 – 2010-12-17 05:21:05
@ cnotethegr8擴大:什麼TTP://modmyi.com/cstats/index.php包= com.modmyi.cnotelite&輸出=多少?正在返回HTML JavaScript? – RageZ 2010-12-17 05:21:26
是的,你可以用AJAX完成同樣的事情。不過,我對jQuery ajax工具並不是非常熟悉,所以我會將具體信息留給其他人。 – 2010-12-17 05:24:46