javascript - jQuery difficulties in FireFox & XHTML -
I have recently switched from XHTML to HTML ... do not start with "why" - let's just say That was not an option for this ...
When I was HTML, then this function was working fine in IE and FF, but now with XHTML I get the following error in FF:
height alignment function revBars ( IsEFBOutput, isIXPPreview) Ribhashit the {ifixPreview) isIXPreview = false; Var heightElement = $ ('& lt; div id = "resizeDetectingElement" style = "position: full; left: -9999999px height: 1em;" & gt; and & # 160; & lt; / div & gt;') .prependTo ('body') .get (0); Height element.centralheight = heightimension.offetheit; // Firebug says that the error is here. included in (); Window.onresize = Refresh; SetInterval (function (if (heightElement.currentHeight! = HeightElement.offsetHeight) {heightElement.currentHeight = heightElement.offsetHeight; Refresh ();}}, 500); Enter function () {var px = "px"; Var Color = (document.styleSheets [0] .href.match ("ftidStyleDay")? "Black white"; $ RevMarks = $ ('. RevMark'). RemoveClass ('Revmark'). AdClass ('uncredited'); If ($ $ RevMarks.length) $ revMarks = $ ('. Unmarked'); $ RevMarks.each (function () ($ ('$ div class = "RevBar" /> & gt; css. ({ 'Background-color': color, 'width': '2px', 'position': 'full', 'left': (IEFbotUP & IISp preview, '.25 AM': '-75'), 'Height': this. Reset (); Reset (); Insert ();} Offset (.); ' Offset (obj) {var top = 0; if (obj.offsetParent) {do {top + = obj.offsetTop;} while (obj = obj.offsetParent);} if (document.all & amp; amp; amp; amp; amp; amp;; IsEFBOutput || (isEFBOutput & isIXPPreview)) Top - = 15; Return head; }}
Any idea why throwing an error in XFML in FF? It still works in IE.
Edit: Again, this code works entirely in FF and IE unless I switch to XHTML. Creates a DOM for XHTML, okay?
I rewrite some of your examples, because you have errors and incomplete with function calls Which are not in the example:
$ (document) .ready (function () {function revBars (isEFBOutput, isIXPPreview) {var test = "& lt; div id = (" some element " } Reburs ();});
At this point heigthElement is present and the div has been added to the DOM. Please correct the problems to solve them.
< P> Update // var heightElement = $ ( ' whatsoever & lt; / div & gt;'). PrependTo ('body') is available (0). // This statement does not work for var height = $ ('Body'). Prepaid (' whatever gt;'); // it does console.log (height element); < / Code> This is basically the same as the first example.
The request element you have made is to add a div before the body and then to get the first element of the body. Returns matching items, so meeting was relevant. And you are attaching an element before the body, it is so normal that your variable will be empty.
Try my code and delete the downvote as many people did not have this type of patience with your supercode.
UPDATE 2 This is an example for prepaid () and prepaid ().
& lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" src = "../ lib / jquery / jquery-1.3.2.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("# test_A"). Prepaid ('& lt; div id = \' test_B \ '& gt; B & lt; / div & gt;'); $ ( "# Test_C") predeto ($ ('$ test_A')); var x = $ ('id id = "resizeDetectingElement"> D & lt; / div & gt;'). PrependTo ('body '). Get (0); console.log (X); // div $ (x) gives .append (' some text '); // works)}; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = 'test_a' & gt; A & lt; / Div & gt; & Lt; Div id = 'test_C' & gt; C & lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
I hope this will help you to work your code. Use $ (height element) not just the height which is not div jQuery object.
Comments
Post a Comment