Weird issue in IE7 Only not in any other browser
Asked Answered
S

2

7

It is a simple HTML ,

i have jquery-ui(1.10) and jquery (1.9.1) . it works fine in IE8,9 ,firefox and in chrome only in IE 7
HTML has something like below. I have no idea what that is and where that is from
this piece of code is not there when i see this HTML in IE8,9 , Firefox and chrome

sizzle-1367496452938="[object Object]

and all the div tags injected with this

jQuery191030626454110549073="6"

Here is some part of the html look like this.Anyone knows what is this issue is?

     <html sizzle-1367496167699="[object Object]">

        <div class="container" id="container2" 
sizzle-1367496452938="[object Object]">


            <div class="arrow-left" id="wppanelstatus" 
    style="width: 1%;" jQuery191030626454110549073="6"/>

UPDATE
I am NOT using sizzle javascript selector library

Stansberry answered 2/5, 2013 at 12:18 Comment(0)
L
6

This is what jQuery uses to attach event handlers etc in IE.

It's called an expando. It's just a string which is basically 'jQuery' + timestamp (in essence a unique value).

And jQuery depends on sizzle so you are definitely using it....

You can read more here: jQuery attribute auto added to elements

Leede answered 2/5, 2013 at 15:5 Comment(2)
is that specific to IE7 Only ?it does not do for other versions /browsersStansberry
Only IE7 and IE8 do it...msdn.microsoft.com/en-us/library/ie/ms533747%28v=vs.85%29.aspx - Expando is an IE-only property that "sets or retrieves a value indicating whether arbitrary variables can be created within the object". Apparently.Leede
S
4

After some research , this answer my question 100%

I am just copy pasting from the above blog

How jQuery Selects Elements Using Sizzle

Selection process

jQuery has a lot of optimization baked in to make things run faster. In this section I will go through some of the queries and will try to trace the route jQuery follows.

$(‘#header’)

When jQuery sees that the input string is just one word and is looking for an id then jQuery invokes document.getElementById . Straight and simple. Sizzle is not invoked.

$(‘#header a’) on a modern browser

If the browser supports querySelectorAll then querySelectorAll will satisfy this request. Sizzle is not invoked.

$(‘.header a[href!=”hello”]’) on a modern browser

In this case jQuery will try to use querySelectorAll but the result would be an exception (atleast on firefox). The browser will throw an exception because the querySelectorAll method does not support certain selection criteria. In this case when browser throws an exception, jQuery will pass on the request to Sizzle. Sizzle not only supports css 3 selector but it goes above and beyond that.

$(‘.header a’) on IE6/7

On IE6/7 querySelectorAll is not available so jQuery will pass on this request to Sizzle. Let’s see a little bit in detail how Sizzle will go about handling this case.

Sizzle gets the selector string ‘.header a’. It splits the string into two parts and stores in variable called parts.

1 parts = ['.header', 'a'] Next step is the one which sets Sizzle apart from other selector engines. Instead of first looking for elements with class header and then going down, Sizzle starts with the outer most selector string. As per this presentation from Paul Irish YUI3 and NWMatcher also go right to left.

Stansberry answered 3/5, 2013 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.