2015-06-12 39 views
-2

我試圖訪問此網站上的源代碼http://aptus-usa.com/calc,這將使我能夠簡單地使用沒有其他鏈接或圖像的功能計算器。我已經獲得了源代碼的訪問權限(我將在下面發佈),我也可以成功刪除鏈接和圖像。但是,計算器的功能缺失。什麼可能導致這個問題考慮,根據對JavaScript文件的網頁鏈接:通過功能獲取對源代碼的訪問

http://aptus-usa.com/resources/jsmodernizr-2.6.1-respond-1.1.0.min.js

http://aptus-usa.com/resources/jsjquery-1.8.2.min

http://aptus-usa.com/resources/jsbootstrap.min.js

有在服務器上沒有文件?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Aptus USA | Plant Nutrition | Nutrient Feed Calculators</title> 
<link rel="stylesheet" type="text/css" href="resources/css/nc.css"/> 
<!--<link rel="stylesheet" type="text/css" href="resources/css/bootstrap.min.css"/>--> 
<script src="http://aptus-usa.com/resources/jsmodernizr-2.6.1-respond-1.1.0.min.js" type="application/javascript"></script> 
<script src="http://aptus-usa.com/resources/jsjquery-1.8.2.min" type="application/javascript"></script> 
<script src="http://aptus-usa.com/resources/jsbootstrap.min.js" type="application/javascript"></script> 

<!--<link rel="stylesheet" type="text/css" href="../assets/css/base.css"/> 
<link rel="stylesheet" type="text/css" href="../assets/css/ncstyles.css"/> 
<link rel="stylesheet" type="text/css" href="../assets/css/ncPrint.css"/> 
<script src="../assets/js/jquery.print.js" type="application/javascript"></script> 
<script src="../assets/js/nc.js" type="application/javascript"></script>--> 
</head> 

<body> 

<div id="logo"><img src="resources/img/APTUS Logo_planttech_Full.png" width="150" /> 
    <h2 style="color:white;font-size:1.3em;margin-top:40px;">Outdoor Growing or<br>Recirculating Hydroponics</h2> 
    <p><a href="http://aptus-usa.com/resources/docs/AptusFeedSchedules.pdf" target="_blank" style="font-size:1.3em"><strong>Download Alternate<br>Feeding Schedules</strong></a></p> 
</div> 
<div id="downloads"> 

</div> 

<form name="calc" method="post" target="_self"> 


<!--Variables table--> 
<table cellpadding="0" cellspacing="0" border="0" class="variablesTable" id="id_variables"> 
    <tr> 
     <td colspan="2" align="center" class="cellHeader">NUTRIENT CALCULATOR</td> 
    </tr> 
    <tr> 
     <td> 
      <select name="vegWeeks" id="id_vegWeeks"> 
                 <option value="1" selected>1</option> 
                 <option value="2" >2</option> 
                 <option value="3" >3</option> 
                 <option value="4" >4</option> 
                 <option value="5" >5</option> 
                 <option value="6" >6</option> 
                 <option value="7" >7</option> 
                 <option value="8" >8</option> 
          </select> 
     </td> 
     <td> 
      <label for="vegWeeks">Vegetative Weeks</label><br /> 
      <span class="subtitle">From clone/seed transplant to flowering</span> 
     </td> 
    </tr> 
    <tr> 
     <td> 
      <select name="bloomWeeks" id="id_bloomWeeks"> 
                 <option value="1" >1</option> 
                 <option value="2" >2</option> 
                 <option value="3" >3</option> 
                 <option value="4" >4</option> 
                 <option value="5" >5</option> 
                 <option value="6" >6</option> 
                 <option value="7" >7</option> 
                 <option value="8" >8</option> 
                 <option value="9" selected>9</option> 
                 <option value="10" >10</option> 
                 <option value="11" >11</option> 
                 <option value="12" >12</option> 
          </select> 
     </td> 
     <td> 
      <label for="bloomWeeks">Bloom Weeks</label><br /> 
      <span class="subtitle">Including the final 'flush' week</span> 
     </td> 
    </tr> 
    <tr> 
     <td> 
      <input type="text" name="resSize" id="id_resSize" value="5" size="6"> 
     </td> 
     <td> 
      <label for="resSize">Gallons in Reservoir</label><br /> 
      <span class="subtitle"> 
       For full cycle nutrient needs, enter your total weekly water usage.<br /> 
       Or, enter your reservoir size for specific mixing instructions. 
      </span> 
     </td> 
    </tr> 
    <tr> 
     <td colspan="2" align="center"> 
      <input type="submit" name="submit" id="submit" /> 
     </td> 
    </tr> 
</table> 

</form> 

</body> 
</html> 

回答

1

從粗略看看該頁面,似乎計算髮生在服務器上,由於表單POST,而不是客戶端。如果不訪問服務器,您將無法訪問該代碼。

+0

如果可以訪問服務器,那麼接下來我需要做什麼才能使代碼在另一個站點上正常工作? –

+0

除非您知道該網站的所有者並且具有登錄到服務器的詳細信息,否則您將無法訪問它。 –

+0

我應該很快收到登錄信息。當我獲得訪問權限時,爲了讓代碼在其他網站上正常運行,我需要做什麼? –

2

該計算器發回到服務器以獲取其結果,因此您將無法在客戶端上運行它。你可以使用iframe來實現類似的結果:

<iframe src="http://aptus-usa.com/calc" width="800" height="500"> 
 
    <p>Your browser does not support iframes.</p> 
 
</iframe>

另外一個需要注意的一點,你應該檢查,如果你要使用計算器,你自己的目的的許可。

+0

我需要刪除頁面上的鏈接和圖像。 –

+0

由於頁面位於不同的域([XSS](http://en.wikipedia.org/wiki/Cross-site_scripting)),因此無法使用iframe。你是否問過原始計算器的作者,如果你可以按照你的意圖使用它? –

+0

公司有人與我聯繫過。這不是爲了我自己的目的。他們希望將計算器嵌入方形空間站點,但他們無法訪問源代碼。不過,她提到他們可以訪問託管網站。 –