Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
onse.innerHTML; //警报(this.phpResponse.next); //需要采取的进一步行动? if(this.phpResponse.next!=未定义) 网关(JSON.stringify([this.phpResponse]); } } xmlHttp.send(空); A_OBJ[gateway.aobj_index].xmlHttp=xmlHttp; 返回true; } /** *获取请求的HTML元素ID的对象 *@return元素对象 */ 函数f_getElement(id) { 返回文档.getElementById(id); }_Php_Javascript - Fatal编程技术网

onse.innerHTML; //警报(this.phpResponse.next); //需要采取的进一步行动? if(this.phpResponse.next!=未定义) 网关(JSON.stringify([this.phpResponse]); } } xmlHttp.send(空); A_OBJ[gateway.aobj_index].xmlHttp=xmlHttp; 返回true; } /** *获取请求的HTML元素ID的对象 *@return元素对象 */ 函数f_getElement(id) { 返回文档.getElementById(id); }

onse.innerHTML; //警报(this.phpResponse.next); //需要采取的进一步行动? if(this.phpResponse.next!=未定义) 网关(JSON.stringify([this.phpResponse]); } } xmlHttp.send(空); A_OBJ[gateway.aobj_index].xmlHttp=xmlHttp; 返回true; } /** *获取请求的HTML元素ID的对象 *@return元素对象 */ 函数f_getElement(id) { 返回文档.getElementById(id); },php,javascript,Php,Javascript,好的,我发现了错误,这是base64编码问题 首先是一个代码错误的JSFIDLE: 奥本萤火虫控制台: 玩一些游戏,添加单词,看看你看到了什么 下面是固定版本: 函数解码\u base64(s) { 变量e={},i,k,v=[],r='',w=String.fromCharCode; 变量n=[[65,91]、[97123]、[48,58]、[43,44]、[47,48]; for(n中的z){ 对于(i=n[z][0];您是否准备好使用jquery分析网络传输?谢谢您的回复。我应该在那

好的,我发现了错误,这是base64编码问题

首先是一个代码错误的JSFIDLE:

奥本萤火虫控制台:

玩一些游戏,添加单词,看看你看到了什么

下面是固定版本:

函数解码\u base64(s)
{
变量e={},i,k,v=[],r='',w=String.fromCharCode;
变量n=[[65,91]、[97123]、[48,58]、[43,44]、[47,48];
for(n中的z){

对于(i=n[z][0];您是否准备好使用jquery分析网络传输?谢谢您的回复。我应该在那里查找什么?据我所知,firebug只是告诉我我已经知道的。例如,在表单返回的POST字符串中,我有action=resource\u RESOURCECATEGORYEDIT\u CORE&utf8CharTest=%C3%A4%E2%84%A2%C2%AE&method=edit&id=968&categoryIds%5B%5D=1&fromKeywords%5B%5D=500_-YWFh&fromKeywords%5B%5D=498_-YWFhYQ%3D%3D&fromKeywords%5D=564_-YWFhYWE%3D&keywords=aaa%2Caaaa&fromUserTags%5B%5D=1_-vvvqx&userTags=bbb%2C+bbbbb关键字变量缺少第三个“aaaaaa”值……我的HTML完全验证,请您提供一个HTML示例进行测试,这很难因为它都包含在更大的代码中。但是,如果您登录,那么访问:您可以编辑关键字(这是问题所在)。注意-此在线版本不进行HTML验证--我的测试代码进行验证,但仍然存在问题,因此我认为验证不是问题。
function doTransfer(target, source)
{
    var targetObj = f_getElement(target);
    var tempText = targetObj.value.split(',');
    var len = tempText.length;
    var targetText = new Array;
    var text;
    var selection;
    var split;
    for(var i = 0; i < len; i ++)
    {
        text = trim(tempText[i]);
        if(text)
            targetText.push(text);
    }
    var sourceObj = f_getElement(source);
    len = sourceObj.options.length;
    for(i = 0; i < len; i++)
    {
        split = sourceObj.options[i].value.split('_');
        selection = decode_base64(split[1]);
// When searching for existing word, we ignore case as different words may be indicated by different use of case on the same letters.
// i.e. we trust the user to get it right.
        if(sourceObj.options[i].selected && (searchArray(targetText, selection) == -1))
            targetText.push(selection);
    }
    targetObj.value = targetText.join(',');
}

function f_getElement(id)
{
    return document.getElementById(id);
}
/**
* Gateway to AJAX javascript functions
* @param input - JSON string representing an array of sets of instructions to be processed in numerical order. At the very
* least a startFunction() method should be present in each set.
*/
function gateway(input)
{
    var parsedInput = JSON.parse(input);
    var inputLen = parsedInput.length;
    if(gateway.aobj_index == undefined)
        gateway.aobj_index = -1;
    gateway.aobj_index++;
    for(var i = 0; i < inputLen; i++)
    {
        if(parsedInput[i].startFunction != undefined)
        {
            A_OBJ[gateway.aobj_index] = new AJAXOBJECT();
            A_OBJ[gateway.aobj_index].input = parsedInput[i];
            A_OBJ[gateway.aobj_index].evalReturn = eval('(' + A_OBJ[gateway.aobj_index].input.startFunction + '())');
            if(A_OBJ[gateway.aobj_index].evalReturn == false)
            {
                return false;
            }
        }
        else
        {
            alert('No startFunction() defined');
            return false;
        }
        gateway.aobj_index++;
    }
    return true;
}

/**
* The object used for independent AJAX instances
*/
function AJAXOBJECT()
{
//properties
    this.input = null;
    this.processedScript = null;
    this.phpResponse = null;
    this.targetObj = null;
    this.evalReturn = null;
// methods
    this.checkInput = checkInput;
    this.doXmlHttp = doXmlHttp;
}

/**
* Check required input parameters are present in input
* @param input array
* @return false|true
*/
function checkInput(inputArray)
{
    var len = inputArray.length;
    for(var i = 0; i < len; i++)
    {
        if(this.input[inputArray[i]] == undefined)
        {
            alert('required input parameter is missing: ' + inputArray[i]);
            return false;
        }
    }
    return true;
}

/**
* Create the xmlHttp object
* @return xmlHttp object
*/  
function createXmlHttpObject()
{
    var xmlHttp = false;
//Check if we are using IE.
    try
    {
//If the javascript version is greater than 5.
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e)
    {
//If not, then use the older active x object.
        try
        {
//If we are using IE.
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        } 
        catch (E)
        {
//Else we must be using a non-IE browser.
            xmlHttp = false;
        }
    }
//If we are using a non-IE browser, create a JavaScript instance of the object.
    if (!xmlHttp && typeof XMLHttpRequest != undefined)
    {
        xmlHttp = new XMLHttpRequest();
    }
    return xmlHttp;
}

/**
* Execute the xmlHTTP object
*
* @return true|false
*/
function doXmlHttp()
{
    if(this.targetObj == null)
    {
        alert('No AJAXOBJECT targetObj property set');
        return false;
    }
    if(this.processedScript == null)
    {
        alert('No AJAXOBJECT processedScript property set');
        return false;
    }
    var targetObj = this.targetObj;
    var xmlHttp = createXmlHttpObject();
    xmlHttp.open("GET", this.processedScript, true);
//alert(this.processedScript);
    xmlHttp.onreadystatechange = function()
    {
        if((xmlHttp.readyState == 4) && (xmlHttp.status == 200))
        {
            try
            {
                this.phpResponse = JSON.parse(xmlHttp.responseText);
            }
            catch(err)
            {
                alert('HTTP status: ' + xmlHttp.status + '. ' + err.message + ' ERROR. PHP says:\n' + xmlHttp.responseText);
                return false;
            }
            if(this.phpResponse.ERROR)
            {
                alert('PHP ERROR:\n' + this.phpResponse.ERROR);
                return false;
            }
            if(this.phpResponse.innerHTML)
                targetObj.innerHTML = this.phpResponse.innerHTML;
//alert(this.phpResponse.next);
// Further action to be taken?
            if(this.phpResponse.next != undefined)
                gateway(JSON.stringify([this.phpResponse]));
        }
    }
    xmlHttp.send(null);
    A_OBJ[gateway.aobj_index].xmlHttp = xmlHttp;
    return true;
}
/**
* Get an object for the requested HTML element ID
* @return element object
*/
function f_getElement(id)
{
    return document.getElementById(id);
}
function decode_base64(s)
{
    var e={},i,k,v=[],r='',w=String.fromCharCode;
    var n=[[65,91],[97,123],[48,58],[43,44],[47,48]];

    for(z in n) {
        for(i=n[z][0];i<n[z][1];i++) {
            v.push(w(i));
        }
    }

    for(i=0;i<64;i++) {
        e[v[i]]=i;
    }

    for(i=0;i<s.length;i+=72) {
        var b=0,c,x,l=0,o=s.substring(i,i+72);
        for(x=0;x<o.length;x++) {
            c=e[o.charAt(x)];b=(b<<6)+c;l+=6;
            while(l>=8) {
            var charCode = (b>>>(l-=8))%256;

                if (charCode > 31) {
                    // only add printable chars
                    r+=w(charCode);
                }
            }
        }
    }
    return r;
}