Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Tuesday, November 19, 2013

JQuery .on() event handler hasznalat a click() helyett dinamikusan letrehozott elemeknel

A click() event handler nem fog mukodni dinaikusan letrehozott elemeknel csak ha a letrehozas utan ujra rakotjuk. Az on() event handler-nel meg lehet adni egy selector-t, tehat ha a $(document).ready()-ben irjuk le az on()-t egy ott mar letezo container item-re amibe bekerul majd dinamikusan a valojaban vizsgalando item akkor minden renben lesz.


<html>
    <button id="add">Add new</button>
    <div id="container">
        <button class="alert">alert!</button>
    </div>
</html>

$("div#container").on('click', 'button.alert', function() {
    alert(1);
});


Monday, April 16, 2012

Web Browser Control rendering mode

Mivel default-bol nem a legfrissebb IE szerint renderel a windowsos web browser control, ezert ha azt szeretnenk, hogy adott oldalt megis ugy renderelje akkor ezt kell megadni:

Thursday, February 17, 2011

Monday, November 15, 2010

Tuesday, May 27, 2008

SOP - Same origin policy

The philosophy of the same origin policy is simple: the browser should not trust content loaded from arbitrary websites. Web pages run within the sandbox and are prevented from accessing resources from other origins. Without this protection, a malicious web page could compromise the confidentiality or integrity of another web page.

The term "origin" is defined using the domain name, protocol and port. Two pages belong to the same origin if and only if these three values are the same.

Thursday, August 16, 2007

7-es elotti IE-nel problemat okozhat a HEAD-hez uj elem hozzaadasa, ha van mar beolvasott BASE tag

A korabban itt es itt emlegetett dinamikus javascript betoltessel kapcsolatban Shaun Inman belefuott egy problemaba IE-nel (7-esnel regebbi):

Ran into a JavaScript problem with everybody’s favorite browser recently. Manipulating the head element from within (say by adding additional script or link elements before the page loads) was resulting in an enormously helpful “Operation Aborted” error message in versions of Internet Explorer prior to 7. Of course, like all things IE, this error’s appearance was inconsistent.

I was eventually able to track the problem down to the presence of a base tag. It didn’t matter if it was an open <base> or a self-closing <base />, if it came before the <script> that was manipulating the head, then IE stopped everything and issued the error. (At this point in script execution document.getElementsByTagName('head')[0] is a valid HTML element so testing for its availability before attempting to appendChild() doesn’t avoid the error. try/catch() is also of no assistance.)

Sunday, August 05, 2007

Henri Sivonen: Activating the Right Layout Mode Using the Doctype Declaration

Itt van az egesz, de par dolgot bemasolok:

In order to deal with both old tag soup written to old browser quirks and new CSS-compliant pages, Firefox (and other Mozilla Gecko-based browsers), Safari, Opera (7 and later), Internet Explorer 6 and 7, Mac IE 5, and Konqueror (3.2 and later) have two main layout modes. In one mode the layout engine attempts to render conforming pages according the CSS specifications. In the other mode the layout engine tries to mimic old browsers. In Firefox these modes are known as “the Standards mode” and “the Quirks mode” respectively. In this document the same names are used also when referring to the modes of the other browsers.

Background

The bugs and non-standard behaviors of old browsers such as Netscape Navigator 4.x and IE 5 for Windows are called “quirks”. For example, not inheriting styles into tables is a quirk. Sometimes pages have been authored in such a way that their layout depends on quirks.

Most quirks are related to layout and, hence, are in conflict with CSS. Rendering quirky pages according to CSS would make them look different from what the author most likely intended. On the other hand, being able to use CSS as specified is a big win compared to writing for old quirks forever.

Layout Modes

To address the conflicting goals of backwards compatibility and CSS conformance, contemporary browsers have two or three layout modes.

Quirks Mode

In the Quirks mode the browsers violate CSS specifications in order to achieve backwards compatible layout. Different browsers implement different quirks. Therefore, “Quirks mode” is not a single target. For example, Mozilla focused on imitating Netscape 4.x initially. Windows IE 6 and 7, on the other hand, are focused on imitating Windows IE 5.

The point of the Quirks mode is avoiding “breaking” old pages. If you are authoring new pages now, you are supposed to comply with the relevant specifications (CSS 2.1 in particular) and target the Standards mode.

Standards Mode

In the Standards mode the browsers try to give conforming documents the specification-wise correct treatment to the extent implemented in a particular browser.

Almost Standards Mode

Firefox, Safari and Opera 7.5 (and later) also have a third mode known as “the Almost Standards mode”, which implements the vertical sizing of table cells traditionally and not rigorously according to the CSS2 specification. Mac IE 5, Windows IE 6 and 7, Opera prior to 7.5 and Konqueror do not need an Almost Standards mode, because they don’t implement the vertical sizing of table cells rigorously according to the CSS2 specification in their respective Standards modes anyway. In fact, their Standards modes are closer to Mozilla’s Almost Standards mode than to Mozilla’s Standards mode. It is important to remember that even though the various browsers have conceptually similar modes, the corresponding modes of the different browsers are not identical.

Firefox, Safari, Opera (7 and later), Windows IE 6 and 7, Mac IE 5 and Konqueror (3.2 and later) all use doctype sniffing in order to decide the layout mode for text/html documents. This means that the mode is picked based on the document type declaration (or the lack thereof) at the beginning of an HTML document. (Documents served using an XML content type always get the Standards mode.)

Szinten itt talalhato egy tablazat is arrol, hogy melyik browser melyik doctype-ot hogyan rendereli.

++++

Anne van Kesteren pedig keszitett egy tablazatot arrol, hogy a browserek hogyan impelementaljak a clientHeight, offsetHeight es scrollHeight-ot a body es html tagen quirks es standards mode-ban.

Friday, July 27, 2007

tag soup

Tag soup is HTML code written without regard for the rules of HTML structure and semantics (HTML is the markup language which composes Web pages). Generally, tag soup is created when the author is using HTML for a presentational document rather than a semantic document. Because web browsers have always treated HTML errors leniently, tag soup is also used by browser implementers to refer to all HTML. HTML must be treated by web browsers as tag soup in comparison to XML where errors need not, and should not, be corrected according to the specification.