开发者

Form target attribute strict compliance and quirks mode

I have a couple of pages in my app in which I generate pdf reports that may take quite a long time to load. So I have the report options form,开发者_JAVA技巧 pop out the report in a new window. So other than not complying with HTML 4.01 standards, are there any downsides (like putting browsers in quirks mode) to having a target attribute on a form.

A second part to the question is how would one go about submitting a form to a new window without a target attribute?


I have noticed some weird stuff with Safari. After changing the target attribute of a form and submitting the form to a new window, all the links in the first document that use href="javascript:... are now dead as doorknobs. They don't go, they don't do, and they don't fire any click or focus events. Doorknobs.

You might be wondering why I'm using href="javascript: type links. I'm actually using ASP.Net LinkButtons, and that is how they are rendered.


So other than not complying with HTML 4.01 standards, are there any downsides (like putting browsers in quirks mode) to having a target attribute on a form.

It won't trigger quirks mode, only the Doctype influences that (and you can switch to a Transitional doctype without leaving standards mode, just use the full HTML 4.01 Transitional one with the URI).

The major disadvantage is that it triggers a new window, and page triggered new windows are horrible. If the delay is the problem, then I'd look at a "You'll get an email when it is ready" approach.


You could use jQuery to submit the form and wait for a reply asynchronously. Once you get the response you could open a popup window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜