我在我的應用程序中使用UIWebView加載請求的http url.Webpage加載url沒有失敗,但其中有作爲java script.problem onclick提交的按鈕沒有任何反應,沒有錯誤在控制檯和uiwebview委託也沒有被解僱,包括錯誤委託。這些按鈕就像圖像視圖一樣。作爲提交按鈕onclick在移動Safari瀏覽器應用程序中做出了很好的迴應。下面我附上我的HTTP URLJavaScript不工作在UIWebview的按鈕onsubmit作爲Safari瀏覽器正常工作?
<!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 id="Head1"><link href="/App_Themes/Common.css" rel="Stylesheet" type="text/css" />
<script src="/Script/siteCommon.js" type="text/javascript" ></script>
<link href="../../App_Themes/default/style.css" type="text/css" rel="stylesheet" /><title>
Change Password
</title></head>
<body>
<form method="post" action="10470" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="_TSM_HiddenField_" id="_TSM_HiddenField_" value="2GFwlGU9ATlFIxrdsXRzcja58_1t5F8HSleaZM4ZQwk1" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE5NDU5NTY1MjYPZBYCZg9kFgICAw9kFgICBw9kFggCAw9kFgICAQ8WAh4EVGV4dAXPAVBsZWFzZSBwcm92aWRlIHRoZSBlbWFpbCBhZGRyZXNzIHlvdSB1c2VkIHRvIHJlZ2lzdGVyIHlvdXIgYWNjb3VudCBhbG9uZyB3aXRoIHlvdXIgY3VycmVudCBwYXNzd29yZC4gIFdoZW4gY2hhbmdpbmcgeW91ciBwYXNzd29yZCwgcGxlYXNlIGJlIHN1cmUgdG8gZm9sbG93IHRoZSBwYXNzd29yZCBydWxlcyBzZXQgZm9ydGggYnkgeW91ciBhZG1pbmlzdHJhdG9yLmQCBQ9kFgICAQ8PFgIfAAUORW1haWwgQWRkcmVzczpkZAIHD2QWBmYPZBYCAgEPDxYCHwAFDU9sZCBQYXNzd29yZDpkZAICDw8WAh8ABQlQYXNzd29yZDpkZAIHDw8WAh8ABRFDb25maXJtIFBhc3N3b3JkOmRkAgkPZBYEAgEPDxYEHwAFDlJlc2V0IFBhc3N3b3JkHgdWaXNpYmxlaGRkAgIPDxYEHwAFBlN1Ym1pdB8BZ2RkZKpTQvPJfWmJqFvdHZIrXesCKRnEIKkDGkSgeZv0B58z" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="/WebResource.axd?d=0yNOlELC71f7MU1kDN0EjQ2&t=635152212760076874" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=c93c_YnvR2d5xbofY3U48Vv2IRMVoKIPk_hrlJ8-C5LxDZb6nfS51RYyYBFDJDWwblnlsXZ0-KwhxpojwLpoQQ2&t=1e961a8d" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=CBZ_3hbD_tfINaKqOHxpx7JALH5uYYEO3oWKa0RYfcnTbdSBTlY7W2hGWTKE5diJ0&t=ffffffff81f1a403" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=CBZ_3hbD_tfINaKqOHxpx7JALH5uYYEO3oWKa0RYfcmlwqDqfxGdA2J9XRFKE5rz0&t=ffffffff81f1a403" type="text/javascript"></script>
<script src="/actions/password/10470?_TSM_CombinedScripts_=True&v=2GFwlGU9ATlFIxrdsXRzcja58_1t5F8HSleaZM4ZQwk1&_TSM_Bundles_=&cdn=False" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=CBZ_3hbD_tfINaKqOHxpxwkS3UqxfzxcZj62hGX0hvK9oQFljrnoDHbkkd4RNQkVAwNoEXOsrlyOHfAU-XrwAw2&t=ffffffff81f1a403" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=CBZ_3hbD_tfINaKqOHxpxyqbdySWicIlJxGXGKbjz5V_OOL5bgqUM-2ewmqJqIBS_FJCzNDx5yt8EYyx12l3wQ2&t=ffffffff81f1a403" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
通過'[[UIApplication的sharedApplication]的OpenURL:[NSURL URLWithString:WEBURL]與野生動物園嘗試;'..現在檢查。 ;) – iPatel
在控制檯中的一些錯誤?並且只有表單,請將按鈕代碼添加到問題 – sage444
@ sage44:我已經添加了來自viewsource文件的幾個代碼以供您參考.i對html和javascript沒有任何意見。所以PLZ讓我知道如果你想更多的信息 –