在Internet Explorer 9中获取请求被中止

时间:2011-09-27 21:08:16

标签: xml flex internet-explorer-9 httprequest httpresponse

如果您将访问网站lab.buffspec.com,请特别使用Internet Explorer 9并选择gildan 6.1,hanes 6.1或gildan hood然后单击获取定价按钮,您将看到尽管更新了数量总价未显示。仅在这3件衬衫的Internet Explorer 9中就会发生这种情况,其他工作正常。而这种行为只发生在IE9中,该网站在firefox和chrome中运行良好。当我在IE9中选择开发人员工具并进入网络选项卡并开始捕获时,我发现请求显示'(已中止)',并且启动器选项卡显示'(待定)'。

有谁知道这里发生了什么?我没有查看其他版本的Internet Explorer。

此外,响应和请求采用XML格式。

 public static function getPricingXml(event:NumericStepperEvent = null):XML
    {
        for each (var side:String in ['front', 'back']) {
            var workspace:Canvas = mx.core.Application.application[side + 'Workspace'];

            var colors:Array = new Array();

            for each (var e:* in workspace.getChildren()) { 
                if (e is Image && e.includeInLayout) {
                    for each (var color:String in e.colors) {
                        if (color) {
                            color = color.toLowerCase();

                            if (color && colors.indexOf(color) == -1) {
                                colors.push(color);
                            }

                        }
                    }
                }
            } 

            mx.core.Application.application[side + "TotalColors"].text = colors.length > 4 ? 4 : colors.length;
        }

        var xml:XML =   <products>
                            <product requiresUndercoat={mx.core.Application.application.color.type !== 'white'}>
                                <color hexValue={mx.core.Application.application.color.hex_color} />
                                <sides>
                                    <front totalColors={mx.core.Application.application.frontTotalColors.text} />
                                    <back totalColors={mx.core.Application.application.backTotalColors.text} />
                                </sides>
                                <sizes />
                                {mx.core.Application.application.names.getXml()}
                            </product>
                        </products>;

        var i:int = 0;
        for each (var size:Object in mx.core.Application.application.color.sizes) {
            xml.product.sizes.appendChild(<size name={size.name} abbreviation={size.abbreviation} quantity={mx.core.Application.application.priceSteppers[i++].value} price={size.price} />);
        }

        return xml;
    }

这是在单击“获取定价”按钮时构建XML请求的flex函数。

<mx:GridItem horizontalAlign="right" width="100%" fontWeight="normal" verticalAlign="middle">
                                        <mx:NumericStepper id="priceSteppers" value="0" maximum="599" fontSize="12" change="getPrices.send({ data: com.buffspec.Lab.getPricingXml(event) });" />
                                    </mx:GridItem>

这是步进器的代码,用于增加数量,并且应该调用获取定价按钮。

<mx:HTTPService id="getPrices" url="http://www.buffspec.com/store/lab/getPricing.php" resultFormat="e4x" />

最后,getPrices是一个httpservice,它从http://www.buffspec.com/store/lab/getPricing.php获取相应的结果作为XML文件。

我注意到,如果这意味着什么,请求和响应的内容类型都是'text / plain'。响应也是HTTP / 200,所以我不知道为什么它会被中止。

1 个答案:

答案 0 :(得分:0)

好吧,我终于明白了。通过GET方法发送的URL是e4x的默认值,超过2083个字符,这是Internet Explorer的上限。当Internet Explorer接收到此大小的URL时,它就会中止GET方法的执行。希望这可以帮助任何有类似问题的人。