我是JavaScript和Ajax的新手。AJAX將表單提交到遠程URL並從XML提取URL reponse
我有一個表單發佈到遠程URL並返回包含一些數據和URL的XML響應。我需要提取URL並將其重定向到XML響應中的URL。
這裏是我的形式
<form target="_blank" action='https://requesturl.co.uk/requestservice.asmx/Request_v4' method="POST" >
<input type='hidden' value='' name='AffiliateID' /><input type='hidden' value='' name='AffiliatePW' /><input type='hidden' value='' name='ReqMode' /><input type='hidden' value='' name='ReqTotalTimeout' /><input type='hidden' value='' name='ReqLenderTimeout' /><input type='hidden' value='' name='ReqLoanAmount' /><input type='hidden' value='' name='AppTitle' /><input type='hidden' value='' name='AppFirstName' /><input type='hidden' value='' name='AppLastName' /><input type='hidden' value='' name='AppEmail' /><input type='hidden' value='' name='AppDOBDay' /><input type='hidden' value='' name='AppDOBMonth' /><input type='hidden' value='' name='AppDOBYear' /><input type='hidden' value='' name='AppHomePhone' /><input type='hidden' value='' name='AppWorkPhone' /><input type='hidden' value='' name='AppMobilePhone' /><input type='hidden' value='' name='AppPostCode' /><input type='hidden' value='' name='AppHouseNumber' /><input type='hidden' value='' name='AppStreet' /><input type='hidden' value='' name='AppTown' /><input type='hidden' value='' name='AppCounty' /><input type='hidden' value='' name='EmpIncomeType' /><input type='hidden' value='' name='EmpEmployerName' /><input type='hidden' value='' name='EmpTimeAtEmployer' /><input type='hidden' value='' name='EmpNetMonthlyPay' /><input type='hidden' value='' name='EmpPayFrequency' /><input type='hidden' value='' name='EmpDirectPayment' /><input type='hidden' value='' name='EmpNextPayDay' /><input type='hidden' value='' name='EmpNextPayMonth' /><input type='hidden' value='' name='EmpNextPayYear' /><input type='hidden' value='' name='EmpFollowingPayDay' /><input type='hidden' value='' name='EmpFollowingPayMonth' /><input type='hidden' value='' name='EmpFollowingPayYear' /><input type='hidden' value='' name='EmpNINumber' /><input type='hidden' value='' name='BankAccount' /><input type='hidden' value='' name='BankSortcode' /><input type='hidden' value='' name='BankDebitCard' /><input type='hidden' value='' name='AppAddressYears' /><input type='hidden' value='' name='AppAddressMonths' /><input type='hidden' value='' name='AppHomeStatus' /><input type='hidden' value='' name='ReqConsent' /><input type='hidden' value='' name='ReqIPAddress' /><input type='hidden' value='' name='ReqAgent' /><input type='hidden' value='' name='ReqMarketingOptIn' /><input type='hidden' value='' name='ReqDomain' />
<input type="submit" value="Invoke" class="button">
XML響應是
<RequestResult><Result>Accepted</Result><FailureReasons/><AcceptedLender>LendingStream</AcceptedLender><RedirectURL>http://redirecttothisURL.com/testing.htm</RedirectURL><PPDReference>6524845</PPDReference></RequestResult>
經過一番研究,它看起來像jQuery的話最好要做到這一點,但我越來越糊塗,如果實際上它發佈到遠程URL將導致問題,由於瀏覽器不允許它。
任何幫助或想法將不勝感激。
感謝