Bug 137135

Summary: iframes error loaded in konqueror
Product: [Applications] konqueror Reporter: Gustavo Loaiza Robles <loaizatavo>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: finex, kollix
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Gustavo Loaiza Robles 2006-11-10 02:05:50 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Fedora RPMs
Compiler:          3.5.4-0.5.fc5 
OS:                Linux

Konqueror doesn't load the iframe's content with document.write inmediately. The solution is to use setTimeout function to give it an extra time.

example:
Error

function actualiza(){
  var cad= '<html><head></head><body>Hello</body></html>';
  window.iframe1.document.open();
  window.iframe1.document.write(cad);
  window.iframe1.document.close();	
		
  return;
}

in the html body
<body> 
  ...
  ...
    <iframe ....>
  <script languaje="javascript">
     actualiza();  //the code fails here
  </script>
</body>


Solution:
function actualiza(){
  var cad= '<html><head></head><body>Hello</body></html>';
  window.iframe1.document.open();
  window.iframe1.document.write(cad);
  window.iframe1.document.close();	
		
  return;
}

in the html body
<body>    
  <body> 
  ...
  ...
  <iframe ....>
  <script languaje="javascript">
     setTimeout('actualiza()', 400);  //this is the solution
  </script>
</body>

</body>
Comment 1 Allan Sandfeld 2006-11-19 17:19:39 UTC
Can you rewrite this into test case that demonstrates what Konqueror does wrong?
Comment 2 FiNeX 2008-04-20 23:08:00 UTC
A testcase could be very helpful!
Comment 3 Martin Koller 2011-06-25 06:47:28 UTC
not reproducible