|
@@ -670,8 +670,11 @@ function getHost(url) {
|
|
|
return host;
|
|
|
}
|
|
|
|
|
|
-function hostconvert(url) {
|
|
|
- if(!url.match(/^http?:\/\//)) url = SITEURL.replace(/(\/+)$/g, '') + '/' + url;
|
|
|
+function hostconvert(url)
|
|
|
+{
|
|
|
+ if(!url.match(/^http[s]?:\/\//)) {
|
|
|
+ url = SITEURL.replace(/(\/+)$/g, '') + '/' + url;
|
|
|
+ }
|
|
|
var url_host = getHost(url);
|
|
|
var cur_host = getHost().toLowerCase();
|
|
|
if(url_host && cur_host != url_host) {
|
|
@@ -814,12 +817,12 @@ function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
|
|
|
var ajaxframeid = 'ajaxframe';
|
|
|
var ajaxframe = $$(ajaxframeid);
|
|
|
var formtarget = $$(formid).target;
|
|
|
- var handleResult = function() {
|
|
|
+ var handleResult = function()
|
|
|
+ {
|
|
|
var s = '';
|
|
|
var evaled = false;
|
|
|
|
|
|
-// showloading('none');
|
|
|
- try {
|
|
|
+ try {
|
|
|
s = $$(ajaxframeid).contentWindow.document.XMLDocument.text;
|
|
|
} catch(e) {
|
|
|
try {
|
|
@@ -861,6 +864,7 @@ function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
|
|
|
ajaxframe.loading = 0;
|
|
|
$$('append_parent').removeChild(ajaxframe.parentNode);
|
|
|
};
|
|
|
+
|
|
|
if(!ajaxframe) {
|
|
|
var div = document.createElement('div');
|
|
|
div.style.display = 'none';
|
|
@@ -876,8 +880,10 @@ function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
|
|
|
//showloading();
|
|
|
$$(formid).target = ajaxframeid;
|
|
|
var action = $$(formid).getAttribute('action');
|
|
|
+ console.log('action=' + action);
|
|
|
action = hostconvert(action);
|
|
|
- $$(formid).action = action.replace(/\&inajax\=1/g, '')+'&inajax=1';
|
|
|
+ console.log('action=' + action);
|
|
|
+ $$(formid).action = action.replace(/\&inajax\=1/g, '')+'&inajax=1';
|
|
|
$$(formid).submit();
|
|
|
if(submitbtn) {
|
|
|
submitbtn.disabled = true;
|