[jQuery] Using .wrap() with IE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I am working on a ASP.NET app with jQuery and have run into an IE error
(everything works great on firefox, of course).
I am trying to rewrite a few div tags using the DOM to make rounded
corners, but when I use the .wrap() function Internet Explorer will not
properly post back to the server (the asp server side event does not
recognize it as a post back) . It appears that the .wrap call mucks
things up -- When I call wrap("<div></div>") I still have
the same problem. However, when I comment it out everything works.
Here is my function, which is being called from my <i>$(document).ready(function(){...})</i>
block:
<tt>// Initialize rounded corners
function initcorners() {
// Adapted from
456bereastreet.com/archive/200505/transparent_custom_corners_and_borders/
// Note: Page wrapper uses divs manually
// Add divs for each box corner
$("div.box").each(function(i){
// Get old box properties
var oldclass = trim(this.className.replace(/\bbox\b/, ''));
var oldid = this.id;
// Wrap boxes
$(this)
<font color="#ff0000">.wrap('<div class="rounded ' +
oldclass + '" id="' + oldid + '"><div class="lborder"><div
class="rborder"></div></div></div>')</font>
.attr("id", "");
// Remove class name (moving to outer box)
if (trim(oldclass) != "")
$(this).removeClass(oldclass);
});
$('div.rounded')
.prepend('<div
class="top"><div></div></div>')
.append('<div
class="bottom"><div></div></div>');
}
</tt>Any ideas?
Does anyone know of any issues specific to jQuery and ASP.NET, I didn't
see anything in the bug tracker.
Thanks,
Chris
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/