This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

都是IE6、IE7、IE8 url长度惹的祸

489 views 0 comments last modified about 9 years ago Raymond Tang

In this page

最近用Ajax来做一个东东,可是在IE8中没错误,IE6、7都出现了错误,最终确认是因为url长度的问题,我的url长度很大有超过4000个字节,而ie6、7不支持这样长的url,ie8是可以,这样就导致了两个问题:

以下将这个长度很长的url简称myurl,且在两个页面都要用到它长长的querystring

1,用模式对话框打开新窗体,即showModalDialog是url过长,ie6、ie7打开的页面出错

2,用ajax的get方法请求另外一个页面ie6、ie7均失败

解决方案:

1,通过showModalDialog的第二个参数,将包含常常的querystring里边的绝大部分内容传到模式对话框,

var result = openDialog(url, input, 600, 400, 'status:yes;help:yes;scroll:yes');//这里的inpu是包含那部分常常内容的input

而模式对话框的页面通过document.getElementById('HiddenXml').value=window.dialogArguments.value;来获取值window.dialogArguments.value,这在ie6、7、8、Firefox3.5下均正常

2,ajax使用post的方法而不是get的方法

if(method=='POST')
{
xml.setRequestHeader("Content-Length",queryString.length);
}
xml.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

记得一定要设置请求头部的content-length和conten-type


Related pages

Issue - Unable to get property 'apply' of undefined or null reference occurred in Angular 4.*, VS2017 15.3, ASP.NET Core 2.0

6162 views   10 comments last modified about 2 years ago

Issue Context After installed Visual Studio 2017 15.3 preview and .net core 2.0 preview SDK, I upgraded one of my existing asp.net core project to 2.0. The project was created using ‘dotnet new angular’ SPA template.  I also upgraded all the client app packages to the latest. For exa...

View detail

[Link] Build SPA on ASP.NET Core with JavaScript Services

402 views   0 comments last modified about 2 years ago

Great introduction about JavaScriptServices ( JavaScriptServices GitHub repository ): Microsoft.AspNetCore.SpaTemplates plugs into dotnet new , providing project templates for Angular 2, Aurelia, Knockout...

View detail

input submit input text css的写法

93 views   0 comments last modified about 10 years ago

本文介绍如何修改input控件submit以及text不同类型的样式。

View detail

JavaScript版本的杨辉三角

248 views   0 comments last modified about 9 years ago

前几天帮一个学弟写的,JavaScript版本的杨辉三角,其实和其他C、Java等等版本的都差不多。代码如下:

View detail

在网页中通过userAgent获取手机获取手机操作系统类型

1352 views   0 comments last modified about 7 years ago

本文介绍如果在JavaScript中根据手机浏览器提供的信息userAgent判断手机操作系统的类型,并执行相应的操作。

View detail

在.Net中使用msxsl:script脚本块扩展XSLT的具体实践与应用

305 views   0 comments last modified about 9 years ago

一概述XSLT可以用于将XML格式的数据转换为其它格式,在数据和展示分开以及数据相互转换中可以得到广泛的应用,比较典型的是以前的动网论坛模板系统以及动易的标签系统。掌握好XSLT可以灵活的处理XML,同时运用在Web应用程序中也非常的方便,不过缺点是使用者需要掌握大量的XPath、XSLT、XML等相关知识。

View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (0)

No comments yet.