You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Tom Desmet <to...@tvh.be> on 2008/01/03 15:48:29 UTC

bug: iframe get request done 2x after ajax change in IE

We have a page that has an iframe and an ajax button.
When the ajax button is clicked, the iframe is replaced by a new iframe with
specific src.

We have encountered the phenomenon where the iframe src is requested 
two times to the server after the button gets clicked.

After some debugging, the problem was pinned down and 
lies within the file org\apache\wicket\ajax\wicket-ajax.js

The problem is within the function "replaceOuterHtmlIE".

There is some kind of "hack" to read the <script> tags within the received
html...

First the content of the div is filled with a table containing received ajax
component markup:
  
  tempDiv.innerHTML = '<table style="display:none">' + text + '</table>';

This way script tags can be retrieved. Afterwards the innerHTML is replaced
by a div containing received text.

  tempDiv.innerHTML = '<div style="display:none">' + text + '</div>'; 

Both statements cause IE to fetch the urls within the contained text (in our
case <iframe src="someurl"></iframe> tags).

We patched this the following way ...

The first occurence of tempDiv.innerHTML, The content of the div is filled
with a table containing a div.

  tempDiv.innerHTML = '<table style="display:none"><div
style="display:none">' + text + '</div></table>';

After the script tags are retrieved, the table gets removed from the
structure, 
and the div within the table is connected to tempDiv.

  var table=tempDiv.firstChild;
  var childDiv=table.firstChild.firstChild;
  tempDiv.removeChild(table);
  tempDiv.appendChild(childDiv);

Would it be possible to apply this patch to the next wicket version?
-- 
View this message in context: http://www.nabble.com/bug%3A-iframe-get-request-done-2x-after-ajax-change-in-IE-tp14598132p14598132.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: bug: iframe get request done 2x after ajax change in IE

Posted by Tom Desmet <to...@tvh.be>.
Hi,

Thank you for looking into this ... The jira issue is created.
https://issues.apache.org/jira/browse/WICKET-1257



Matej Knopp-2 wrote:
> 
> Can you please create a jira issue with this? I have to test first if
> the fix doesn't break other things.
> 
> -Matej
> 
> On Jan 3, 2008 3:48 PM, Tom Desmet <to...@tvh.be> wrote:
>>
>> We have a page that has an iframe and an ajax button.
>> When the ajax button is clicked, the iframe is replaced by a new iframe
>> with
>> specific src.
>>
>> We have encountered the phenomenon where the iframe src is requested
>> two times to the server after the button gets clicked.
>>
>> After some debugging, the problem was pinned down and
>> lies within the file org\apache\wicket\ajax\wicket-ajax.js
>>
>> The problem is within the function "replaceOuterHtmlIE".
>>
>> There is some kind of "hack" to read the <script> tags within the
>> received
>> html...
>>
>> First the content of the div is filled with a table containing received
>> ajax
>> component markup:
>>
>>   tempDiv.innerHTML = '<table style="display:none">' + text + '</table>';
>>
>> This way script tags can be retrieved. Afterwards the innerHTML is
>> replaced
>> by a div containing received text.
>>
>>   tempDiv.innerHTML = '<div style="display:none">' + text + '</div>';
>>
>> Both statements cause IE to fetch the urls within the contained text (in
>> our
>> case <iframe src="someurl"></iframe> tags).
>>
>> We patched this the following way ...
>>
>> The first occurence of tempDiv.innerHTML, The content of the div is
>> filled
>> with a table containing a div.
>>
>>   tempDiv.innerHTML = '<table style="display:none"><div
>> style="display:none">' + text + '</div></table>';
>>
>> After the script tags are retrieved, the table gets removed from the
>> structure,
>> and the div within the table is connected to tempDiv.
>>
>>   var table=tempDiv.firstChild;
>>   var childDiv=table.firstChild.firstChild;
>>   tempDiv.removeChild(table);
>>   tempDiv.appendChild(childDiv);
>>
>> Would it be possible to apply this patch to the next wicket version?
>> --
>> View this message in context:
>> http://www.nabble.com/bug%3A-iframe-get-request-done-2x-after-ajax-change-in-IE-tp14598132p14598132.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/bug%3A-iframe-get-request-done-2x-after-ajax-change-in-IE-tp14598132p14598565.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: bug: iframe get request done 2x after ajax change in IE

Posted by Matej Knopp <ma...@gmail.com>.
Can you please create a jira issue with this? I have to test first if
the fix doesn't break other things.

-Matej

On Jan 3, 2008 3:48 PM, Tom Desmet <to...@tvh.be> wrote:
>
> We have a page that has an iframe and an ajax button.
> When the ajax button is clicked, the iframe is replaced by a new iframe with
> specific src.
>
> We have encountered the phenomenon where the iframe src is requested
> two times to the server after the button gets clicked.
>
> After some debugging, the problem was pinned down and
> lies within the file org\apache\wicket\ajax\wicket-ajax.js
>
> The problem is within the function "replaceOuterHtmlIE".
>
> There is some kind of "hack" to read the <script> tags within the received
> html...
>
> First the content of the div is filled with a table containing received ajax
> component markup:
>
>   tempDiv.innerHTML = '<table style="display:none">' + text + '</table>';
>
> This way script tags can be retrieved. Afterwards the innerHTML is replaced
> by a div containing received text.
>
>   tempDiv.innerHTML = '<div style="display:none">' + text + '</div>';
>
> Both statements cause IE to fetch the urls within the contained text (in our
> case <iframe src="someurl"></iframe> tags).
>
> We patched this the following way ...
>
> The first occurence of tempDiv.innerHTML, The content of the div is filled
> with a table containing a div.
>
>   tempDiv.innerHTML = '<table style="display:none"><div
> style="display:none">' + text + '</div></table>';
>
> After the script tags are retrieved, the table gets removed from the
> structure,
> and the div within the table is connected to tempDiv.
>
>   var table=tempDiv.firstChild;
>   var childDiv=table.firstChild.firstChild;
>   tempDiv.removeChild(table);
>   tempDiv.appendChild(childDiv);
>
> Would it be possible to apply this patch to the next wicket version?
> --
> View this message in context: http://www.nabble.com/bug%3A-iframe-get-request-done-2x-after-ajax-change-in-IE-tp14598132p14598132.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>