Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6758775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:50:32+00:00 2026-05-26T13:50:32+00:00

Debugging a complex jQuery-based application that wasn’t working in Opera browser, I traced back

  • 0

Debugging a complex jQuery-based application that wasn’t working in Opera browser, I traced back the issue to the fact that Opera is ruining my DOM tree when I load some HTML inside a jQuery UI Dialog widget. This is the HTML template (a valid HTML 4.0.1 fragment according to W3C Validator):

<form action="" method="post">
    <p>Form starts here.</p>
    <p><input type="text" size="30" value="input in paragraph"></p>
    <table>
    <tr>
        <td><input type="text" size="30" value="input in table"></td>
    </tr>
    </table>
    <p>Form ends here.</p>
</form>

… and this is the generated HTML as seen by Opera:

<p class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 230px" scrolltop="0" scrollleft="0">
    <form action="" method="post">
        <p>Form starts here.</p>
        <p><input type="text" size="30" value="input in paragraph"/></p>
    </form>
    <table>
        <tbody>
            <tr>
                <td><input type="text" size="30" value="input in table"/></td>
            </tr>
        </tbody>
    </table>
    <p>Form ends here.</p>
</p>

I’ve written a small test case. You should save the HTML template as “form.html” in the same directory as this HTML doc:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- UTF-8 sin BOM (€ÁÑ) -->
<html>
<head><title>Bug DOM Opera</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<style type="text/css"><!--
*{
    font-size: 10pt !important;
    font-family: sans-serif;
}
h1{
    font-size: 12pt !important;
}
form{
    margin: 0.25em 0;
    padding: 0.25em;
    border: 1px solid black;
}
input{
    background-color: #C77C7A;
}
form input{
    background-color: #7CC592;
}
--></style>
<script type="text/javascript"><!--
jQuery(function($){
    // Open form in dialogue on button click
    $("button").click(function(){
        var $dialogo = $('<p>No data yet</p>')
            .dialog({
                modal: true,
                width: 500,
                height: 300,
                close: function(){
                    $(this).dialog("destroy");
                }
            }).dialog("open");
        $.ajax({
            url: "form.html",
            dataType: "html",
            success: function(data, textStatus, XMLHttpRequest){
                $dialogo.html(data);
            }
        });
    });

    // Open form on load (no dialogue)
    $("<div></div>").appendTo("body").load("form.html");
});
//--></script>
</head>
<body>

<h1>Bug DOM Opera</h1>
<p><button>Open dialogue</button></p>

</body>
</html>

If you run it in Opera, you’ll see that you can inject the HTML template with regular AJAX and everything is fine (revealed by green background in <input> elements). However, if you inject it in a Dialog widget, the DOM structure changes (red background). It works as expected in Firefox, Chrome and Internet Explorer.

Have I overlooked an error in my code? Have I hit a bug in Opera or jQuery UI?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:50:32+00:00Added an answer on May 26, 2026 at 1:50 pm

    After a long investigation, I can tell you it’s an opera bug from the current version of Opera.

    the html method of Jquery say :

    This method uses the browser’s innerHTML property. Some browsers may
    not generate a DOM that exactly replicates the HTML source provided.
    For example, Internet Explorer prior to version 8 will convert all
    href properties on links to absolute URLs, and Internet Explorer prior
    to version 9 will not correctly handle HTML5 elements without the
    addition of a separate compatibility layer.

    But nothing about opera.
    I’m currently using opera stable 11.51 and I have the bug you’re telling about.
    But if you use Opera Next which is Opera 12.00 alpha. You can download it here : http://my.opera.com/desktopteam/blog/

    It works correctly.

    So I don’t know how to fix it for the current version of Opera… but we know it’s a bug form the innerhtml of the current version of Opera 🙂

    Hope it’ll help you and hope you’ll find a solution to make it works on current stable release of Opera.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was debugging an issue with a view controller recently and noticed that each
I have a working WCF service and worker role that I have been debugging
I had issues with debugging some very complex integration test in our application. The
So, I am debugging a pretty complex financial reporting application, where almost all of
I need to debug a web application that uses jQuery to do some fairly
I'm working on some code that uses error_log() for debugging. The problem is that
I'm currently debugging some fairly complex persistence code, and trying to increase test coverage
Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision. Running
Debugging with gdb, any c++ code that uses STL/boost is still a nightmare. Anyone
Debugging a PHP program, is there any add-on/plug-in for browser which I can view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.