473,388 Members | 1,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

I don't think that an iframe is a popup

Hi

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
  1. ....
  2. <body onclick="request()">
  3.  
  4. <!--<iframe src="" id="Iframe" name="Iframe"></iframe>--<-- remove
  5. the comments and it works -->
  6.  
  7. <script type="text/javascript">
  8. onload = function() {
  9. s = document.createElement('iframe');
  10. s.src = '';
  11. s.id = s.name = 'Iframe';
  12. document.body.appendChild(s);
  13.  
  14. f = document.createElement('form');
  15. f.id = f.name = 'Form';
  16. f.action = '';
  17. f.method = 'post';
  18. f.target = 'Iframe';
  19. f.style.display = 'none';
  20. document.body.appendChild(f);
  21. }
  22.  
  23. request = function() {
  24. f.action='...';
  25. f.submit();
  26. }
  27. </script>
  28. ....
  29.  
How you see a form and iframe are created on load, then the function
"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

Sep 14 '06 #1
3 1569
webEater said the following on 9/14/2006 6:33 PM:
Hi

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-
There is a better work around if you control the data you are getting
from the server. Simply dynamically load .js files and format your data
for processing on the client. It can all be done without ajax at all.

<snip>
request = function() {
f.action='...';
f.submit();
f refers to *nothing*. Try using document.forms['Form'].action and
submit() and at least then it works in Mozilla/Firefox. It does what you
want in IE7 but I don't have IE6 so I can't test it there right now.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 15 '06 #2
There is a better work around if you control the data you are getting
from the server. Simply dynamically load .js files and format your data
for processing on the client. It can all be done without ajax at all.
I tried this out (for make cross domain requests) but I wasn't able to
read the innerHTML of a script tag (in the case a file is included by
src="...").
f refers to *nothing*. Try using document.forms['Form'].action and
submit() and at least then it works in Mozilla/Firefox. It does what you
want in IE7 but I don't have IE6 so I can't test it there right now.
I think that f holds the form element I created. But I will try your
advice,

thank you

Andi

Sep 15 '06 #3
webEater said the following on 9/15/2006 5:44 AM:
>There is a better work around if you control the data you are getting
from the server. Simply dynamically load .js files and format your data
for processing on the client. It can all be done without ajax at all.

I tried this out (for make cross domain requests) but I wasn't able to
read the innerHTML of a script tag (in the case a file is included by
src="...").
That's not how you dynamically load a .js file though.
>f refers to *nothing*. Try using document.forms['Form'].action and
submit() and at least then it works in Mozilla/Firefox. It does what you
want in IE7 but I don't have IE6 so I can't test it there right now.

I think that f holds the form element I created.
When you get to the request function, it doesn't.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: S'fly | last post by:
Hi, I'm struggling with the famous "gatekeeper" a little. Normally, it opens in a popup window, and from there it goes on. But I like this script to open in an iframe, and not in a popup. It...
2
by: sebastiraj | last post by:
I have one JSP program in which one iframe is defined. And the source of which is an another jsp. Contents of an iframe is in hyperlink. When i click any of the hyperlinks one popup box will come....
1
by: nospam | last post by:
All I am trying to achieve the following: Main window page's asp code writes the following line to launch a popup window (note the IFRAME has to be in the popup window, it cannot be in the...
3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
7
by: ukrbend | last post by:
I use an iframe on my home page and everything works perfectly. But now I decided to add a popups to my page. The popups come not from within the iframe but from the parent frame. Again, everything...
1
by: XP | last post by:
Hello Everyone, I was stuck with this really frustrating problem for sometime. Let me explain what I am trying to achieve: There is a form and an inner iframe. The form's target is set to the...
1
by: jadeite100 | last post by:
Hi: I am using IE 6 SP2. My resize attribute does not work <body onresize="test1();">. When I resize my window, the resize event doesnot get call. I have a jsp page with an iFrame called...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.