I have a problem with a piece of javascript. i am working on a
workaround for non ajax compatible browser like ie 5/6 without activeX
and opera8-
I use dynamically created iframes and forms to make a request, a simple
version for you to understand:
Expand|Select|Wrap|Line Numbers
- ....
- <body onclick="request()">
- <!--<iframe src="" id="Iframe" name="Iframe"></iframe>--<-- remove
- the comments and it works -->
- <script type="text/javascript">
- onload = function() {
- s = document.createElement('iframe');
- s.src = '';
- s.id = s.name = 'Iframe';
- document.body.appendChild(s);
- f = document.createElement('form');
- f.id = f.name = 'Form';
- f.action = '';
- f.method = 'post';
- f.target = 'Iframe';
- f.style.display = 'none';
- document.body.appendChild(f);
- }
- request = function() {
- f.action='...';
- f.submit();
- }
- </script>
- ....
"request" is started when you click somewhere in the body.
- If the iframe is dynamically created - this case - ie 5 opens a popup
with the content of the iframe and ie 6 shows an error. All the other
browsers behave normally.
- If I don't create it by function but simply include it in source
code, it works in ie too
I don't understand it but it's a bug, the only work to workaround this
is to use GET as request method.
Does somebody know this problem?
Thanks,
Andi