I have two simple pages I'm using for testing.
On my first page, I use $.load()
to load a div
from the second page.
Both pages contains the plugin to do the cornering. If I load the first page which loads the div from the second page, the cornering does not work. However, if I load the second page myself, the cornering does work so it's to do with $.load().
Here's some code, from page 1:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#load").load('testLoadCornering2.aspx #loadMe');
});
</script>
<script src="resources/js/curvycorners.js" type="text/javascript"></script>
<script src="resources/js/curvycorners.src.js" type="text/javascript"></script>
<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
<link href="resources/css/buttons.css" rel="stylesheet" type="text/css" />
<link href="resources/css/confirm.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="load" class="BWTable">
</div>
</form>
</body>
</html>
You see the page trying to load the second div.
And the second page:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="resources/js/curvycorners.js" type="text/javascript"></script>
<script src="resources/js/curvycorners.src.js" type="text/javascript"></script>
<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
<link href="resources/css/buttons.css" rel="stylesheet" type="text/css" />
<link href="resources/css/confirm.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="loadMe" class="BWTable">
<p>
Test Test Test Test Test Test Test
</p>
</div>
</form>
</body>
</html>
And the CSS it uses for the rounding (along with the rounded corners plugin):
background-image: url( '../../images/wp_form2.gif' );
border: solid 1px #000000;
margin-left: auto;
margin-right: auto;
text-align: center;
color: white;
-moz-border-radius: 10px; /* Rounded corners plugin */
-webkit-border-radius: 10px; /* Rounded corners plugin */
In Firefox, this works fine - but in IE (specially version 8 I've been trying) the corners are never rounded.
To reiterate, manually going to the second page in IE 8 corners correctly, it's only when the .load() method is used.
Any help appreciated.
Note: I'm aware I shouldn't need to add the style sheets on both pages etc as they should be loaded from the first page, but I've added them to show you the full code of what it's trying to do. Thanks, Ricky
Thanks Lazarus. You put me on the right tracks and I've worked out the solution, this works. I feel a bit silly now!
Thanks again.
Page 1:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
<link href="resources/css/buttons.css" rel="stylesheet" type="text/css" />
<link href="resources/css/confirm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {
$("#load").load('testLoadCornering2.aspx #loadMe');
$.getScript('resources/js/curvycorners.js', function() {
$(this).init();
});
$.getScript('resources/js/curvycorners.src.js', function() {
$(this).init();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="load" class="BWTable">
</div>
</form>
</body>
</html>
Page 2:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div id="loadMe" class="BWTable">
<p>
Test Test Test Test Test Test Test
</p>
</div>
</form>
</body>
</html>