2013-01-16 91 views
0

我想要在我的phonegap-jquery移動應用程序中集成paypal捐贈按鈕,但該按鈕沒有出現,也沒有工作。有什麼方法可以顯示按鈕或任何簡單的方法來顯示我的應用程序內的貝寶?如何集成PayPal捐贈按鈕在Phonegap,JQuery Mobile與Dreamweaver

這裏是應用程序代碼 -

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>jQuery Mobile Web App</title> 
<link href="file:///C|/Program Files/Adobe/Adobe Dreamweaver CS5.5/Configuration/Third Party Source Code/jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css"/> 
<script src="file:///C|/Program Files/Adobe/Adobe Dreamweaver CS5.5/Configuration/Third Party Source Code/jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script> 
<script src="file:///C|/Program Files/Adobe/Adobe Dreamweaver CS5.5/Configuration/Third Party Source Code/jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script> 
<!-- This reference to phonegap.js will allow for code hints as long as the current site has been configured as a mobile application. 
    To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... --> 
<script src="/phonegap.js" type="text/javascript"></script> 
</head> 
<body> 

<div data-role="page" id="page"> 
    <div data-role="header"> 
     <h1>Page One</h1> 
    </div> 
    <div data-role="content"> 
     <ul data-role="listview"> 
      <li><a href="#page2">Page Two</a></li> 
      <li><a href="#page3">Page Three</a></li> 
      <li><a href="#page4">Page Four</a></li> 
     </ul>  
    </div> 
    <div data-role="footer"> 
     <h4>Page Footer</h4> 
    </div> 
</div> 

,這裏是按鈕代碼 -

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_donations"> 
<input type="hidden" name="business" value="[email protected]"> 
<input type="hidden" name="lc" value="US"> 
<input type="hidden" name="item_name" value="Test"> 
<input type="hidden" name="no_note" value="0"> 
<input type="hidden" name="currency_code" value="USD"> 
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest"> 
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 

,當我在任何頁面中添加按鈕的代碼,一個空白按鈕就會出現,不什麼都顯示!任何想法?

+0

你有沒有想過它? – aharris88

回答

0

對於一個腳本的鏈接不會被PhoneGap的

<script src="file:///C|/Program Files/Adobe/Adobe Dreamweaver CS5.5/Configuration/Third Party Source Code/jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script> 

工作的時候編譯的路徑是僅適用於本地計算機。您需要使用相對路徑,如jquery-mobile/jquery-1.5.min.js作爲腳本src

該按鈕看起來像是從互聯網上拉取它的圖像,您是否允許在Phonegap中訪問該域? 另一種選擇是下載圖片,並使用相對鏈接到它,而隨後的HTTP:如果你想使用第一個選項//鏈接

,看看在白名單域引導

http://docs.phonegap.com/en/2.3.0/guide_whitelist_index.md.html