How can I get Stackoverflow / Stackexchange - like tooltips for tags?

When you hover over Stackoverflow, a tooltip appears, as shown below. This is probably implemented through jquery.append as it embeds the HTML at the very end of the HTML document. For each hover event, after some time delay, an AJAX request is executed, possibly via jquery.load (...)

The url request sent to webapps.stackexchange.com is, for example, _ = 1318962590136, which is a dynamic identifier.

  • 1) How does it work on the client and server side, and what are the benefits?

The payload for the toolkit is HTML and looks like this:

<div><div class="tm-heading">...</div></div><span>.......</span>

When you exit the tag, dynamically loaded HTML is deleted. The css styles are already present in the loaded css list of the stackoverflow site.

  • 2). The originally declared event does not seem to be related to the stylized link element <a>that makes up the tag. It seems that only mousedown events are declared (checked via Chrome).

The JavaScript-DeObfuscator gives some hints: event listeners are dynamically added and removed as well ...

function (a, b, c) {
    a.removeEventListener && a.removeEventListener(b, c, !1);
}

enter image description here

+5
source share
1 answer

, hover, , x . , , .

( , , ) - , Comet. , , (.. ). , , . ( ) Facebook , .

+2

All Articles