From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/he/web/api/console/index.html | 294 ++++++++++ files/he/web/api/console/log/index.html | 39 ++ files/he/web/api/document/index.html | 488 +++++++++++++++++ files/he/web/api/document/write/index.html | 82 +++ files/he/web/api/domstring/index.html | 50 ++ files/he/web/api/element/index.html | 331 ++++++++++++ files/he/web/api/geolocation/index.html | 109 ++++ .../index.html" | 250 +++++++++ files/he/web/api/index.html | 38 ++ .../index.html | 141 +++++ files/he/web/api/indexeddb_api/index.html | 165 ++++++ files/he/web/api/storage/clear/index.html | 52 ++ files/he/web/api/storage/getitem/index.html | 75 +++ files/he/web/api/storage/index.html | 107 ++++ files/he/web/api/storage/key/index.html | 55 ++ files/he/web/api/storage/length/index.html | 51 ++ files/he/web/api/storage/removeitem/index.html | 66 +++ files/he/web/api/storage/setitem/index.html | 69 +++ files/he/web/api/web_storage_api/index.html | 111 ++++ files/he/web/api/window/alert/index.html | 70 +++ files/he/web/api/window/confirm/index.html | 70 +++ files/he/web/api/window/index.html | 509 ++++++++++++++++++ files/he/web/api/window/localstorage/index.html | 82 +++ files/he/web/api/window/prompt/index.html | 90 ++++ files/he/web/api/xmlhttprequest/index.html | 172 ++++++ files/he/web/css/index.html | 97 ++++ files/he/web/css/position/index.html | 274 ++++++++++ files/he/web/guide/html/html5/index.html | 177 ++++++ files/he/web/guide/index.html | 62 +++ .../index.html | 62 +++ files/he/web/guide/performance/index.html | 23 + files/he/web/html/element/a/index.html | 90 ++++ files/he/web/html/element/address/index.html | 77 +++ files/he/web/html/element/applet/index.html | 37 ++ files/he/web/html/element/article/index.html | 102 ++++ files/he/web/html/element/aside/index.html | 75 +++ files/he/web/html/element/b/index.html | 68 +++ files/he/web/html/element/bdi/index.html | 60 +++ files/he/web/html/element/br/index.html | 62 +++ files/he/web/html/element/canvas/index.html | 70 +++ files/he/web/html/element/center/index.html | 104 ++++ files/he/web/html/element/cite/index.html | 52 ++ files/he/web/html/element/del/index.html | 64 +++ files/he/web/html/element/em/index.html | 64 +++ files/he/web/html/element/figcaption/index.html | 67 +++ files/he/web/html/element/figure/index.html | 112 ++++ files/he/web/html/element/font/index.html | 38 ++ files/he/web/html/element/footer/index.html | 62 +++ files/he/web/html/element/head/index.html | 68 +++ files/he/web/html/element/header/index.html | 72 +++ .../web/html/element/heading_elements/index.html | 77 +++ files/he/web/html/element/hgroup/index.html | 69 +++ files/he/web/html/element/hr/index.html | 74 +++ files/he/web/html/element/html/index.html | 59 ++ files/he/web/html/element/index.html | 105 ++++ files/he/web/html/element/ins/index.html | 58 ++ files/he/web/html/element/main/index.html | 77 +++ files/he/web/html/element/mark/index.html | 86 +++ files/he/web/html/element/nav/index.html | 70 +++ files/he/web/html/element/p/index.html | 74 +++ files/he/web/html/element/section/index.html | 67 +++ files/he/web/html/element/strong/index.html | 69 +++ files/he/web/html/element/table/index.html | 162 ++++++ files/he/web/html/element/time/index.html | 93 ++++ files/he/web/html/element/title/index.html | 61 +++ files/he/web/html/index.html | 108 ++++ files/he/web/http/index.html | 91 ++++ files/he/web/http/status/403/index.html | 55 ++ files/he/web/http/status/index.html | 197 +++++++ files/he/web/hypertext_markup_language/index.html | 90 ++++ files/he/web/index.html | 121 +++++ files/he/web/javascript/guide/index.html | 125 +++++ files/he/web/javascript/index.html | 97 ++++ .../he/web/javascript/reference/errors/index.html | 31 ++ .../functions/default_parameters/index.html | 216 ++++++++ .../web/javascript/reference/functions/index.html | 596 +++++++++++++++++++++ .../reference/global_objects/array/from/index.html | 243 +++++++++ .../global_objects/array/includes/index.html | 169 ++++++ .../reference/global_objects/array/index.html | 485 +++++++++++++++++ .../global_objects/array/unshift/index.html | 94 ++++ .../javascript/reference/global_objects/index.html | 183 +++++++ .../global_objects/object/assign/index.html | 272 ++++++++++ .../reference/global_objects/object/index.html | 184 +++++++ .../reference/global_objects/promise/index.html | 244 +++++++++ .../reference/global_objects/string/index.html | 314 +++++++++++ files/he/web/javascript/reference/index.html | 58 ++ .../operators/destructuring_assignment/index.html | 416 ++++++++++++++ .../web/javascript/reference/operators/index.html | 289 ++++++++++ .../operators/operator_precedence/index.html | 330 ++++++++++++ .../reference/statements/const/index.html | 133 +++++ .../reference/statements/for...of/index.html | 269 ++++++++++ .../reference/statements/for_each...in/index.html | 128 +++++ .../reference/statements/function_star_/index.html | 212 ++++++++ .../web/javascript/reference/statements/index.html | 148 +++++ .../reference/statements/return/index.html | 151 ++++++ .../javascript/reference/statements/var/index.html | 171 ++++++ 96 files changed, 13026 insertions(+) create mode 100644 files/he/web/api/console/index.html create mode 100644 files/he/web/api/console/log/index.html create mode 100644 files/he/web/api/document/index.html create mode 100644 files/he/web/api/document/write/index.html create mode 100644 files/he/web/api/domstring/index.html create mode 100644 files/he/web/api/element/index.html create mode 100644 files/he/web/api/geolocation/index.html create mode 100644 "files/he/web/api/geolocation/\327\236\327\236\327\251\327\247_\327\251\327\231\327\250\327\225\327\252\327\231_\327\236\327\231\327\247\327\225\327\235/index.html" create mode 100644 files/he/web/api/index.html create mode 100644 files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html create mode 100644 files/he/web/api/indexeddb_api/index.html create mode 100644 files/he/web/api/storage/clear/index.html create mode 100644 files/he/web/api/storage/getitem/index.html create mode 100644 files/he/web/api/storage/index.html create mode 100644 files/he/web/api/storage/key/index.html create mode 100644 files/he/web/api/storage/length/index.html create mode 100644 files/he/web/api/storage/removeitem/index.html create mode 100644 files/he/web/api/storage/setitem/index.html create mode 100644 files/he/web/api/web_storage_api/index.html create mode 100644 files/he/web/api/window/alert/index.html create mode 100644 files/he/web/api/window/confirm/index.html create mode 100644 files/he/web/api/window/index.html create mode 100644 files/he/web/api/window/localstorage/index.html create mode 100644 files/he/web/api/window/prompt/index.html create mode 100644 files/he/web/api/xmlhttprequest/index.html create mode 100644 files/he/web/css/index.html create mode 100644 files/he/web/css/position/index.html create mode 100644 files/he/web/guide/html/html5/index.html create mode 100644 files/he/web/guide/index.html create mode 100644 files/he/web/guide/localizations_and_character_encodings/index.html create mode 100644 files/he/web/guide/performance/index.html create mode 100644 files/he/web/html/element/a/index.html create mode 100644 files/he/web/html/element/address/index.html create mode 100644 files/he/web/html/element/applet/index.html create mode 100644 files/he/web/html/element/article/index.html create mode 100644 files/he/web/html/element/aside/index.html create mode 100644 files/he/web/html/element/b/index.html create mode 100644 files/he/web/html/element/bdi/index.html create mode 100644 files/he/web/html/element/br/index.html create mode 100644 files/he/web/html/element/canvas/index.html create mode 100644 files/he/web/html/element/center/index.html create mode 100644 files/he/web/html/element/cite/index.html create mode 100644 files/he/web/html/element/del/index.html create mode 100644 files/he/web/html/element/em/index.html create mode 100644 files/he/web/html/element/figcaption/index.html create mode 100644 files/he/web/html/element/figure/index.html create mode 100644 files/he/web/html/element/font/index.html create mode 100644 files/he/web/html/element/footer/index.html create mode 100644 files/he/web/html/element/head/index.html create mode 100644 files/he/web/html/element/header/index.html create mode 100644 files/he/web/html/element/heading_elements/index.html create mode 100644 files/he/web/html/element/hgroup/index.html create mode 100644 files/he/web/html/element/hr/index.html create mode 100644 files/he/web/html/element/html/index.html create mode 100644 files/he/web/html/element/index.html create mode 100644 files/he/web/html/element/ins/index.html create mode 100644 files/he/web/html/element/main/index.html create mode 100644 files/he/web/html/element/mark/index.html create mode 100644 files/he/web/html/element/nav/index.html create mode 100644 files/he/web/html/element/p/index.html create mode 100644 files/he/web/html/element/section/index.html create mode 100644 files/he/web/html/element/strong/index.html create mode 100644 files/he/web/html/element/table/index.html create mode 100644 files/he/web/html/element/time/index.html create mode 100644 files/he/web/html/element/title/index.html create mode 100644 files/he/web/html/index.html create mode 100644 files/he/web/http/index.html create mode 100644 files/he/web/http/status/403/index.html create mode 100644 files/he/web/http/status/index.html create mode 100644 files/he/web/hypertext_markup_language/index.html create mode 100644 files/he/web/index.html create mode 100644 files/he/web/javascript/guide/index.html create mode 100644 files/he/web/javascript/index.html create mode 100644 files/he/web/javascript/reference/errors/index.html create mode 100644 files/he/web/javascript/reference/functions/default_parameters/index.html create mode 100644 files/he/web/javascript/reference/functions/index.html create mode 100644 files/he/web/javascript/reference/global_objects/array/from/index.html create mode 100644 files/he/web/javascript/reference/global_objects/array/includes/index.html create mode 100644 files/he/web/javascript/reference/global_objects/array/index.html create mode 100644 files/he/web/javascript/reference/global_objects/array/unshift/index.html create mode 100644 files/he/web/javascript/reference/global_objects/index.html create mode 100644 files/he/web/javascript/reference/global_objects/object/assign/index.html create mode 100644 files/he/web/javascript/reference/global_objects/object/index.html create mode 100644 files/he/web/javascript/reference/global_objects/promise/index.html create mode 100644 files/he/web/javascript/reference/global_objects/string/index.html create mode 100644 files/he/web/javascript/reference/index.html create mode 100644 files/he/web/javascript/reference/operators/destructuring_assignment/index.html create mode 100644 files/he/web/javascript/reference/operators/index.html create mode 100644 files/he/web/javascript/reference/operators/operator_precedence/index.html create mode 100644 files/he/web/javascript/reference/statements/const/index.html create mode 100644 files/he/web/javascript/reference/statements/for...of/index.html create mode 100644 files/he/web/javascript/reference/statements/for_each...in/index.html create mode 100644 files/he/web/javascript/reference/statements/function_star_/index.html create mode 100644 files/he/web/javascript/reference/statements/index.html create mode 100644 files/he/web/javascript/reference/statements/return/index.html create mode 100644 files/he/web/javascript/reference/statements/var/index.html (limited to 'files/he/web') diff --git a/files/he/web/api/console/index.html b/files/he/web/api/console/index.html new file mode 100644 index 0000000000..61521af0f3 --- /dev/null +++ b/files/he/web/api/console/index.html @@ -0,0 +1,294 @@ +--- +title: Console +slug: Web/API/Console +tags: + - API + - Debugging + - Interface + - NeedsTranslation + - Reference + - TopicStub + - console + - web console +translation_of: Web/API/Console +--- +
{{APIRef("Console API")}}
+ +

The Console object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided.

+ +

The Console object can be accessed from any global object. {{domxref("Window")}} on browsing scopes and {{domxref("WorkerGlobalScope")}} as specific variants in workers via the property console. It's exposed as {{domxref("Window.console")}}, and can be referenced as simply console. For example:

+ +
console.log("Failed to open the specified link")
+ +

This page documents the {{anch("Methods")}} available on the Console object and gives a few {{anch("Usage")}} examples.

+ +

{{AvailableInWorkers}}

+ +

Methods

+ +
+
{{domxref("Console.assert()")}}
+
Log a message and stack trace to console if the first argument is false.
+
{{domxref("Console.clear()")}}
+
Clear the console.
+
{{domxref("Console.count()")}}
+
Log the number of times this line has been called with the given label.
+
{{domxref("Console.countReset()")}}
+
Resets the value of the counter with the given label.
+
{{domxref("Console.debug()")}}
+
Outputs a message to the console with the log level "debug". +
Note: Starting with Chromium 58 this method only appears in Chromium browser consoles when level "Verbose" is selected.
+
+
{{domxref("Console.dir()")}}
+
Displays an interactive listing of the properties of a specified JavaScript object. This listing lets you use disclosure triangles to examine the contents of child objects.
+
{{domxref("Console.dirxml()")}}
+
+

Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible.

+
+
{{domxref("Console.error()")}}
+
Outputs an error message. You may use string substitution and additional arguments with this method.
+
{{domxref("Console.exception()")}} {{Non-standard_inline}} {{deprecated_inline}}
+
An alias for error().
+
{{domxref("Console.group()")}}
+
Creates a new inline group, indenting all following output by another level. To move back out a level, call groupEnd().
+
{{domxref("Console.groupCollapsed()")}}
+
Creates a new inline group, indenting all following output by another level. However, unlike group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call groupEnd().
+
{{domxref("Console.groupEnd()")}}
+
Exits the current inline group.
+
{{domxref("Console.info()")}}
+
Informative logging of information. You may use string substitution and additional arguments with this method.
+
{{domxref("Console.log()")}}
+
For general output of logging information. You may use string substitution and additional arguments with this method.
+
{{domxref("Console.profile()")}} {{Non-standard_inline}}
+
Starts the browser's built-in profiler (for example, the Firefox performance tool). You can specify an optional name for the profile.
+
{{domxref("Console.profileEnd()")}} {{Non-standard_inline}}
+
Stops the profiler. You can see the resulting profile in the browser's performance tool (for example, the Firefox performance tool).
+
{{domxref("Console.table()")}}
+
Displays tabular data as a table.
+
{{domxref("Console.time()")}}
+
Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page.
+
{{domxref("Console.timeEnd()")}}
+
Stops the specified timer and logs the elapsed time in seconds since it started.
+
{{domxref("Console.timeLog()")}}
+
Logs the value of the specified timer to the console.
+
{{domxref("Console.timeStamp()")}} {{Non-standard_inline}}
+
Adds a marker to the browser's Timeline or Waterfall tool.
+
{{domxref("Console.trace()")}}
+
Outputs a stack trace.
+
{{domxref("Console.warn()")}}
+
Outputs a warning message. You may use string substitution and additional arguments with this method.
+
+ +

Usage

+ +

Outputting text to the console

+ +

The most frequently-used feature of the console is logging of text and other data. There are four categories of output you can generate, using the {{domxref("console.log()")}}, {{domxref("console.info()")}}, {{domxref("console.warn()")}}, and {{domxref("console.error()")}} methods respectively. Each of these results in output styled differently in the log, and you can use the filtering controls provided by your browser to only view the kinds of output that interest you.

+ +

There are two ways to use each of the output methods; you can simply pass in a list of objects whose string representations get concatenated into one string, then output to the console, or you can pass in a string containing zero or more substitution strings followed by a list of objects to replace them.

+ +

Outputting a single object

+ +

The simplest way to use the logging methods is to output a single object:

+ +
var someObject = { str: "Some text", id: 5 };
+console.log(someObject);
+
+ +

The output looks something like this:

+ +
[09:27:13.475] ({str:"Some text", id:5})
+ +

Outputting multiple objects

+ +

You can also output multiple objects by simply listing them when calling the logging method, like this:

+ +
var car = "Dodge Charger";
+var someObject = { str: "Some text", id: 5 };
+console.info("My first car was a", car, ". The object is:", someObject);
+ +

This output will look like this:

+ +
[09:28:22.711] My first car was a Dodge Charger . The object is: ({str:"Some text", id:5})
+
+ +

Using string substitutions

+ +

Gecko 9.0 {{geckoRelease("9.0")}} introduced support for string substitutions. When passing a string to one of the console object's methods that accepts a string, you may use these substitution strings:

+ + + + + + + + + + + + + + + + + + + + + + + + +
Substitution stringDescription
%o or %OOutputs a JavaScript object. Clicking the object name opens more information about it in the inspector.
%d or %iOutputs an integer. Number formatting is supported, for example  console.log("Foo %.2d", 1.1) will output the number as two significant figures with a leading 0: Foo 01
%sOutputs a string.
%fOutputs a floating-point value. Formatting is supported, for example  console.log("Foo %.2f", 1.1) will output the number to 2 decimal places: Foo 1.10
+ +
+

Note: Precision formatting doesn't work in Chrome

+
+ +

Each of these pulls the next argument after the format string off the parameter list. For example:

+ +
for (var i=0; i<5; i++) {
+  console.log("Hello, %s. You've called me %d times.", "Bob", i+1);
+}
+
+ +

The output looks like this:

+ +
[13:14:13.481] Hello, Bob. You've called me 1 times.
+[13:14:13.483] Hello, Bob. You've called me 2 times.
+[13:14:13.485] Hello, Bob. You've called me 3 times.
+[13:14:13.487] Hello, Bob. You've called me 4 times.
+[13:14:13.488] Hello, Bob. You've called me 5 times.
+
+ +

Styling console output

+ +

You can use the %c directive to apply a CSS style to console output:

+ +
console.log("This is %cMy stylish message", "color: yellow; font-style: italic; background-color: blue;padding: 2px");
+ +
The text before the directive will not be affected, but the text after the directive will be styled using the CSS declarations in the parameter.
+ +
 
+ +
+ +
 
+ +
+

Note: Quite a few CSS properties are supported by this styling; you should experiment and see which ones prove useful.

+
+ +
 
+ +
{{h3_gecko_minversion("Using groups in the console", "9.0")}}
+ +

You can use nested groups to help organize your output by visually combining related material. To create a new nested block, call console.group(). The console.groupCollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading.

+ +
Note: Collapsed groups are not supported yet in Gecko; the groupCollapsed() method is the same as group() at this time.
+ +

To exit the current group, simply call console.groupEnd(). For example, given this code:

+ +
console.log("This is the outer level");
+console.group();
+console.log("Level 2");
+console.group();
+console.log("Level 3");
+console.warn("More of level 3");
+console.groupEnd();
+console.log("Back to level 2");
+console.groupEnd();
+console.debug("Back to the outer level");
+
+ +

The output looks like this:

+ +

nesting.png

+ +
{{h3_gecko_minversion("Timers", "10.0")}}
+ +

In order to calculate the duration of a specific operation, Gecko 10 introduced the support of timers in the console object. To start a timer, call the console.time() method, giving it a name as the only parameter. To stop the timer, and to get the elapsed time in milliseconds, just call the console.timeEnd() method, again passing the timer's name as the parameter. Up to 10,000 timers can run simultaneously on a given page.

+ +

For example, given this code:

+ +
console.time("answer time");
+alert("Click to continue");
+console.timeLog("answer time");
+alert("Do a bunch of other stuff...");
+console.timeEnd("answer time");
+
+ +

Will log the time needed by the user to dismiss the alert box, log the time to the console, wait for the user to dismiss the second alert, and then log the ending time to the console:

+ +

timerresult.png

+ +

Notice that the timer's name is displayed both when the timer is started and when it's stopped.

+ +
Note: It's important to note that if you're using this to log the timing for network traffic, the timer will report the total time for the transaction, while the time listed in the network panel is just the amount of time required for the header. If you have response body logging enabled, the time listed for the response header and body combined should match what you see in the console output.
+ +

Stack traces

+ +

The console object also supports outputting a stack trace; this will show you the call path taken to reach the point at which you call {{domxref("console.trace()")}}. Given code like this:

+ +
function foo() {
+  function bar() {
+    console.trace();
+  }
+  bar();
+}
+
+foo();
+
+ +

The output in the console looks something like this:

+ +

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Console API')}}{{Spec2('Console API')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.Console")}}

+ +

Notes

+ + + +

See also

+ + + +

Other implementations

+ + diff --git a/files/he/web/api/console/log/index.html b/files/he/web/api/console/log/index.html new file mode 100644 index 0000000000..8ea8ab6218 --- /dev/null +++ b/files/he/web/api/console/log/index.html @@ -0,0 +1,39 @@ +--- +title: Console.log() +slug: Web/API/Console/log +translation_of: Web/API/Console/log +--- +
{{APIRef("Console API")}}
+ +

()Console.log - מציגה את פלט ההודעה באזור המסוף של דפדפן האינטרנט.

+ +

תחביר

+ +
console.log(obj1 [, obj2, ..., objN]);
+console.log(msg [, subst1, ..., substN]);
+
+ +

מפרט

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Console API", "#log", "console.log()")}}{{Spec2("Console API")}}Initial definition
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Console.log")}}

diff --git a/files/he/web/api/document/index.html b/files/he/web/api/document/index.html new file mode 100644 index 0000000000..d380692a64 --- /dev/null +++ b/files/he/web/api/document/index.html @@ -0,0 +1,488 @@ +--- +title: Document +slug: Web/API/Document +tags: + - API + - DOM + - Document + - Interface + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/API/Document +--- +

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as {{HTMLElement("body")}} and {{HTMLElement("table")}}, among many others. It provides functionality globally to the document, like how to obtain the page's URL and create new elements in the document.

+ +

{{inheritanceDiagram}}

+ +

The Document interface describes the common properties and methods for any kind of document. Depending on the document's type (e.g. HTML, XML, SVG, …), a larger API is available: HTML documents, served with the "text/html" content type, also implement the {{domxref("HTMLDocument")}} interface, whereas XML and SVG documents implement the {{domxref("XMLDocument")}} interface.

+ +

Constructor

+ +
+
{{domxref("Document.Document","Document()")}}{{non-standard_inline}}
+
Creates a new Document object.
+
+ +

Properties

+ +

This interface also inherits from the {{domxref("Node")}} and {{domxref("EventTarget")}} interfaces.

+ +
+
{{domxref("Document.anchors")}} {{readonlyinline}}
+
Returns a list of all of the anchors in the document.
+
{{domxref("Document.body")}}
+
Returns the {{HTMLElement("body")}} or {{htmlelement("frameset")}} node of the current document.
+
{{domxref("Document.characterSet")}} {{readonlyinline}}
+
Returns the character set being used by the document.
+
{{domxref("Document.compatMode")}} {{readonlyinline}} {{experimental_inline}}
+
Indicates whether the document is rendered in quirks or strict mode.
+
{{domxref("Document.contentType")}} {{readonlyinline}} {{experimental_inline}}
+
Returns the Content-Type from the MIME Header of the current document.
+
{{domxref("Document.doctype")}} {{readonlyinline}}
+
Returns the Document Type Definition (DTD) of the current document.
+
{{domxref("Document.documentElement")}} {{readonlyinline}}
+
Returns the {{domxref("Element")}} that is a direct child of the document. For HTML documents, this is normally the {{domxref("HTMLElement")}} element.
+
{{domxref("Document.documentURI")}} {{readonlyinline}}
+
Returns the document location as a string.
+
{{domxref("Document.embeds")}} {{readonlyinline}}
+
Returns a list of the embedded {{HTMLElement('embed')}} elements within the current document.
+
{{domxref("Document.fonts")}}
+
Returns the {{domxref("FontFaceSet")}} interface of the current document.
+
{{domxref("Document.forms")}} {{readonlyinline}}
+
Returns a list of the {{HTMLElement("form")}} elements within the current document.
+
{{domxref("Document.head")}} {{readonlyinline}}
+
Returns the {{HTMLElement("head")}} element of the current document.
+
{{domxref("Document.hidden")}} {{readonlyinline}}
+
+
{{domxref("Document.images")}} {{readonlyinline}}
+
Returns a list of the images in the current document.
+
{{domxref("Document.implementation")}} {{readonlyinline}}
+
Returns the DOM implementation associated with the current document.
+
{{domxref("Document.lastStyleSheetSet")}} {{readonlyinline}}
+
Returns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of {{domxref("document.selectedStyleSheetSet","selectedStyleSheetSet")}}.
+
{{domxref("Document.links")}} {{readonlyinline}}
+
Returns a list of all the hyperlinks in the document.
+
{{domxref("Document.mozSyntheticDocument")}} {{non-standard_inline}} {{gecko_minversion_inline("8.0")}}
+
Returns a {{jsxref("Boolean")}} that is true only if this document is synthetic, such as a standalone image, video, audio file, or the like.
+
{{domxref("Document.mozFullScreenElement")}} {{readonlyinline}} {{non-standard_inline}} {{gecko_minversion_inline("9.0")}}
+
The element that's currently in full screen mode for this document.
+
{{domxref("Document.mozFullScreenEnabled")}} {{readonlyinline}} {{non-standard_inline}} {{gecko_minversion_inline("9.0")}}
+
true if calling {{domxref("Element.mozRequestFullscreen()")}} would succeed in the current document.
+
{{domxref("Document.plugins")}} {{readonlyinline}}
+
Returns a list of the available plugins.
+
{{domxref("Document.policy")}} {{readonlyinline}}{{experimental_inline}}
+
Returns the {{domxref("Policy")}} interface which provides a simple API for introspecting the feature policies applied to a specific document.
+
{{domxref("Document.preferredStyleSheetSet")}} {{readonlyinline}}
+
Returns the preferred style sheet set as specified by the page author.
+
{{domxref("Document.scripts")}} {{readonlyinline}}
+
Returns all the {{HTMLElement("script")}} elements on the document.
+
{{domxref("Document.scrollingElement")}} {{readonlyinline}}
+
Returns a reference to the {{domxref("Element")}} that scrolls the document.
+
{{domxref("Document.selectedStyleSheetSet")}}
+
Returns which style sheet set is currently in use.
+
{{domxref("Document.styleSheetSets")}} {{readonlyinline}}
+
Returns a list of the style sheet sets available on the document.
+
{{domxref("Document.timeline")}} {{readonlyinline}}
+
+
{{domxref("Document.undoManager")}} {{readonlyinline}} {{experimental_inline}}
+
+
{{domxref("Document.visibilityState")}} {{readonlyinline}}
+
Returns a string denoting the visibility state of the document. Possible values are visiblehiddenprerender, and unloaded.
+
+ +

The Document interface is extended with the {{domxref("ParentNode")}} interface:

+ +

{{page("/en-US/docs/Web/API/ParentNode","Properties")}}

+ +

Extensions for HTMLDocument

+ +

The Document interface for HTML documents inherits from the {{domxref("HTMLDocument")}} interface or, since HTML5,  is extended for such documents.

+ +
+
{{domxref("Document.cookie")}}
+
Returns a semicolon-separated list of the cookies for that document or sets a single cookie.
+
{{domxref("Document.defaultView")}} {{readonlyinline}}
+
Returns a reference to the window object.
+
{{domxref("Document.designMode")}}
+
Gets/sets the ability to edit the whole document.
+
{{domxref("Document.dir")}} {{readonlyinline}}
+
Gets/sets directionality (rtl/ltr) of the document.
+
{{domxref("Document.domain")}}
+
Gets/sets the domain of the current document.
+
{{domxref("Document.lastModified")}} {{readonlyinline}}
+
Returns the date on which the document was last modified.
+
{{domxref("Document.location")}} {{readonlyinline}}
+
Returns the URI of the current document.
+
{{domxref("Document.readyState")}} {{readonlyinline}} {{gecko_minversion_inline("1.9.2")}}
+
Returns loading status of the document.
+
{{domxref("Document.referrer")}} {{readonlyinline}}
+
Returns the URI of the page that linked to this page.
+
{{domxref("Document.title")}}
+
Sets or gets the title of the current document.
+
{{domxref("Document.URL")}} {{readonlyInline}}
+
Returns the document location as a string.
+
+ +

Properties included from DocumentOrShadowRoot

+ +

The Document interface includes the following properties defined on the {{domxref("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the {{domxref("Document")}} interface.

+ +
+
{{domxref("DocumentOrShadowRoot.activeElement")}} {{readonlyInline}}
+
Returns the {{domxref('Element')}} within the shadow tree that has focus.
+
{{domxref("Document.fullscreenElement")}} {{readonlyinline}}
+
The element that's currently in full screen mode for this document.
+
{{domxref("DocumentOrShadowRoot.pointerLockElement")}} {{readonlyinline}} {{experimental_inline}}
+
Returns the element set as the target for mouse events while the pointer is locked. null if lock is pending, pointer is unlocked, or if the target is in another document.
+
{{domxref("DocumentOrShadowRoot.styleSheets")}} {{readonlyInline}}
+
Returns a {{domxref('StyleSheetList')}} of {{domxref('CSSStyleSheet')}} objects for stylesheets explicitly linked into, or embedded in a document.
+
+ +

Event handlers

+ +
+
{{domxref("Document.onafterscriptexecute")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("afterscriptexecute")}} event.
+
{{domxref("Document.onbeforescriptexecute")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("beforescriptexecute")}} event.
+
{{domxref("Document.oncopy")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("copy")}} event.
+
{{domxref("Document.oncut")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("cut")}} event.
+
{{domxref("Document.onfullscreenchange")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("fullscreenchange")}} event is raised.
+
{{domxref("Document.onfullscreenerror")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("fullscreenerror")}} event is raised.
+
{{domxref("Document.onpaste")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("paste")}} event.
+
{{domxref("Document.onpointerlockchange")}} {{experimental_inline}}
+
Represents the event handling code for the {{event("pointerlockchange")}} event.
+
{{domxref("Document.onpointerlockerror")}} {{experimental_inline}}
+
Represents the event handling code for the {{event("pointerlockerror")}} event.
+
{{domxref("Document.onreadystatechange")}} {{gecko_minversion_inline("1.9.2")}}
+
Represents the event handling code for the {{event("readystatechange")}} event.
+
{{domxref("Document.onselectionchange")}} {{experimental_inline}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("selectionchange")}} event is raised.
+
{{domxref("Document.onvisibilitychange")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("visibilitychange")}} event is raised.
+
{{domxref("Document.onwheel")}} {{non-standard_inline}}
+
Represents the event handling code for the {{event("wheel")}} event.
+
+ +

The Document interface is extended with the {{domxref("GlobalEventHandlers")}} interface:

+ +

{{Page("/en-US/docs/Web/API/GlobalEventHandlers", "Properties")}}

+ +

Deprecated properties

+ +
+
{{domxref("Document.alinkColor")}} {{Deprecated_inline}}
+
Returns or sets the color of active links in the document body.
+
{{domxref("Document.all")}} {{Deprecated_inline}} {{non-standard_inline}}
+
Provides access to all elements in the document. This is a legacy, non-standard property and should not be used.
+
{{domxref("Document.applets")}} {{Deprecated_inline}} {{readonlyinline}}
+
Returns an ordered list of the applets within a document.
+
{{domxref("Document.async")}} {{Deprecated_inline}}
+
Used with {{domxref("Document.load")}} to indicate an asynchronous request.
+
{{domxref("Document.bgColor")}} {{Deprecated_inline}}
+
Gets/sets the background color of the current document.
+
{{domxref("Document.charset")}} {{readonlyinline}} {{Deprecated_inline}}
+
Alias of {{domxref("Document.characterSet")}}. Use this property instead.
+
{{domxref("Document.domConfig")}} {{Deprecated_inline}}
+
Should return a {{domxref("DOMConfiguration")}} object.
+
{{domxref("document.fgColor")}} {{Deprecated_inline}}
+
Gets/sets the foreground color, or text color, of the current document.
+
{{domxref("Document.fullscreen")}} {{obsolete_inline}}
+
true when the document is in {{domxref("Using_full-screen_mode","full-screen mode")}}.
+
{{domxref("Document.height")}} {{non-standard_inline}} {{obsolete_inline}}
+
Gets/sets the height of the current document.
+
{{domxref("Document.inputEncoding")}} {{readonlyinline}} {{Deprecated_inline}}
+
Alias of {{domxref("Document.characterSet")}}. Use this property instead.
+
{{domxref("Document.linkColor")}} {{Deprecated_inline}}
+
Gets/sets the color of hyperlinks in the document.
+
{{domxref("Document.vlinkColor")}} {{Deprecated_inline}}
+
Gets/sets the color of visited hyperlinks.
+
{{domxref("Document.width")}} {{non-standard_inline}} {{obsolete_inline}}
+
Returns the width of the current document.
+
{{domxref("Document.xmlEncoding")}} {{Deprecated_inline}}
+
Returns the encoding as determined by the XML declaration.
+
{{domxref("Document.xmlStandalone")}} {{obsolete_inline("10.0")}}
+
Returns true if the XML declaration specifies the document to be standalone (e.g., An external part of the DTD affects the document's content), else false.
+
{{domxref("Document.xmlVersion")}} {{obsolete_inline("10.0")}}
+
Returns the version number as specified in the XML declaration or "1.0" if the declaration is absent.
+
+ +

Methods

+ +

This interface also inherits from the {{domxref("Node")}} and {{domxref("EventTarget")}} interfaces.

+ +
+
{{domxref("Document.adoptNode()")}}
+
Adopt node from an external document.
+
{{domxref("Document.captureEvents()")}} {{Deprecated_inline}}
+
See {{domxref("Window.captureEvents")}}.
+
{{domxref("Document.caretRangeFromPoint()")}}{{non-standard_inline}}
+
Gets a {{Domxref("Range")}} object for the document fragment under the specified coordinates.
+
{{domxref("Document.createAttribute()")}}
+
Creates a new {{domxref("Attr")}} object and returns it.
+
{{domxref("Document.createAttributeNS()")}}
+
Creates a new attribute node in a given namespace and returns it.
+
{{domxref("Document.createCDATASection()")}}
+
Creates a new CDATA node and returns it.
+
{{domxref("Document.createComment()")}}
+
Creates a new comment node and returns it.
+
{{domxref("Document.createDocumentFragment()")}}
+
Creates a new document fragment.
+
{{domxref("Document.createElement()")}}
+
Creates a new element with the given tag name.
+
{{domxref("Document.createElementNS()")}}
+
Creates a new element with the given tag name and namespace URI.
+
{{domxref("Document.createEntityReference()")}} {{obsolete_inline}}
+
Creates a new entity reference object and returns it.
+
{{domxref("Document.createEvent()")}}
+
Creates an event object.
+
{{domxref("Document.createNodeIterator()")}}
+
Creates a {{domxref("NodeIterator")}} object.
+
{{domxref("Document.createProcessingInstruction()")}}
+
Creates a new {{domxref("ProcessingInstruction")}} object.
+
{{domxref("Document.createRange()")}}
+
Creates a {{domxref("Range")}} object.
+
{{domxref("Document.createTextNode()")}}
+
Creates a text node.
+
{{domxref("Document.createTouch()")}} {{Deprecated_inline}}
+
Creates a {{domxref("Touch")}} object.
+
{{domxref("Document.createTouchList()")}}
+
Creates a {{domxref("TouchList")}} object.
+
{{domxref("Document.createTreeWalker()")}}
+
Creates a {{domxref("TreeWalker")}} object.
+
{{domxref("Document.enableStyleSheetsForSet()")}}
+
Enables the style sheets for the specified style sheet set.
+
{{domxref("Document.exitPointerLock()")}} {{experimental_inline}}
+
Release the pointer lock.
+
{{domxref("Document.getAnimations()")}} {{experimental_inline}}
+
Returns an array of all {{domxref("Animation")}} objects currently in effect, whose target elements are descendants of the document.
+
{{domxref("Document.getElementsByClassName()")}}
+
Returns a list of elements with the given class name.
+
{{domxref("Document.getElementsByTagName()")}}
+
Returns a list of elements with the given tag name.
+
{{domxref("Document.getElementsByTagNameNS()")}}
+
Returns a list of elements with the given tag name and namespace.
+
{{domxref("Document.importNode()")}}
+
Returns a clone of a node from an external document.
+
{{domxref("Document.normalizeDocument()")}} {{obsolete_inline}}
+
Replaces entities, normalizes text nodes, etc.
+
{{domxref("Document.releaseCapture()")}} {{non-standard_inline}} {{gecko_minversion_inline("2.0")}}
+
Releases the current mouse capture if it's on an element in this document.
+
{{domxref("Document.releaseEvents()")}} {{non-standard_inline}} {{Deprecated_inline}}
+
See {{domxref("Window.releaseEvents()")}}.
+
{{domxref("Document.routeEvent()")}} {{non-standard_inline}} {{obsolete_inline(24)}}
+
See {{domxref("Window.routeEvent()")}}.
+
{{domxref("Document.mozSetImageElement()")}} {{non-standard_inline}} {{gecko_minversion_inline("2.0")}}
+
Allows you to change the element being used as the background image for a specified element ID.
+
+ +

The Document interface is extended with the {{domxref("ParentNode")}} interface:

+ +
+
{{domxref("document.getElementById","document.getElementById(String id)")}}
+
Returns an object reference to the identified element.
+
{{domxref("document.querySelector","document.querySelector(String selector)")}} {{gecko_minversion_inline("1.9.1")}}
+
Returns the first Element node within the document, in document order, that matches the specified selectors.
+
{{domxref("document.querySelectorAll","document.querySelectorAll(String selector)")}} {{gecko_minversion_inline("1.9.1")}}
+
Returns a list of all the Element nodes within the document that match the specified selectors.
+
+ +

The Document interface is extended with the {{domxref("XPathEvaluator")}} interface:

+ +
+
{{domxref("document.createExpression","document.createExpression(String expression, XPathNSResolver resolver)")}}
+
Compiles an XPathExpression which can then be used for (repeated) evaluations.
+
{{domxref("document.createNSResolver","document.createNSResolver(Node resolver)")}}
+
Creates an {{domxref("XPathNSResolver")}} object.
+
{{domxref("document.evaluate","document.evaluate(String expression, Node contextNode, XPathNSResolver resolver, Number type, Object result)")}}
+
Evaluates an XPath expression.
+
+ +

Extension for HTML documents

+ +

The Document interface for HTML documents inherit from the {{domxref("HTMLDocument")}} interface or, since HTML5,  is extended for such documents:

+ +
+
{{domxref("document.clear()")}} {{non-standard_inline}} {{Deprecated_inline}}
+
In majority of modern browsers, including recent versions of Firefox and Internet Explorer, this method does nothing.
+
{{domxref("document.close()")}}
+
Closes a document stream for writing.
+
{{domxref("document.execCommand","document.execCommand(String command[, Boolean showUI[, String value]])")}}
+
On an editable document, executes a formating command.
+
{{domxref("document.getElementsByName","document.getElementsByName(String name)")}}
+
Returns a list of elements with the given name.
+
{{domxref("document.hasFocus()")}}
+
Returns true if the focus is currently located anywhere inside the specified document.
+
{{domxref("document.open()")}}
+
Opens a document stream for writing.
+
{{domxref("document.queryCommandEnabled","document.queryCommandEnabled(String command)")}}
+
Returns true if the formating command can be executed on the current range.
+
{{domxref("document.queryCommandIndeterm","document.queryCommandIndeterm(String command)")}}
+
Returns true if the formating command is in an indeterminate state on the current range.
+
{{domxref("document.queryCommandState","document.queryCommandState(String command)")}}
+
Returns true if the formating command has been executed on the current range.
+
{{domxref("document.queryCommandSupported","document.queryCommandSupported(String command)")}}
+
Returns true if the formating command is supported on the current range.
+
{{domxref("document.queryCommandValue","document.queryCommandValue(String command)")}}
+
Returns the current value of the current range for a formating command.
+
{{domxref("document.write","document.write(String text)")}}
+
Writes text in a document.
+
{{domxref("document.writeln","document.writeln(String text)")}}
+
Writes a line of text in a document.
+
+ +

Methods included from DocumentOrShadowRoot

+ +

The Document interface includes the following methods defined on the {{domxref("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the {{domxref("Document")}} interface.

+ +
+
{{domxref("DocumentOrShadowRoot.getSelection()")}}
+
Returns a {{domxref('Selection')}} object representing the range of text selected by the user, or the current position of the caret.
+
{{domxref("DocumentOrShadowRoot.elementFromPoint()")}}
+
Returns the topmost element at the specified coordinates.
+
{{domxref("DocumentOrShadowRoot.elementsFromPoint()")}}
+
Returns an array of all elements at the specified coordinates.
+
{{domxref("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
Returns a {{domxref('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.
+
+ +

Non-standard extensions {{non-standard_inline}}

+ +
{{non-standard_header}}
+ +

Firefox notes

+ +

Mozilla defines a set of non-standard properties made only for XUL content:

+ +
+
{{domxref("document.currentScript")}} {{non-standard_inline}} {{gecko_minversion_inline("2.0")}}
+
Returns the {{HTMLElement("script")}} element that is currently executing.
+
{{domxref("document.documentURIObject")}} {{gecko_minversion_inline("1.9")}}
+
(Mozilla add-ons only!) Returns the {{Interface("nsIURI")}} object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).
+
{{domxref("document.popupNode")}}
+
Returns the node upon which a popup was invoked.
+
{{domxref("document.tooltipNode")}}
+
Returns the node which is the target of the current tooltip.
+
+ +

Mozilla also define some non-standard methods:

+ +
+
{{domxref("document.execCommandShowHelp")}} {{obsolete_inline("14.0")}}
+
This method never did anything and always threw an exception, so it was removed in Gecko 14.0 {{geckoRelease("14.0")}}.
+
{{domxref("document.getBoxObjectFor")}} {{obsolete_inline}}
+
Use the {{domxref("Element.getBoundingClientRect()")}} method instead.
+
{{domxref("document.loadOverlay")}} {{Fx_minversion_inline("1.5")}}
+
Loads a XUL overlay dynamically. This only works in XUL documents.
+
{{domxref("document.queryCommandText")}} {{obsolete_inline("14.0")}}
+
This method never did anything but throw an exception, and was removed in Gecko 14.0 {{geckoRelease("14.0")}}.
+
+ +

Internet Explorer notes

+ +

Microsoft defines some non-standard properties:

+ +
+
{{domxref("document.fileSize")}}* {{non-standard_inline}} {{obsolete_inline}}
+
Returns size in bytes of the document. Starting with Internet Explorer 11, that property is no longer supported. See MSDN.
+
+ +

Internet Explorer does not support all methods from the Node interface in the Document interface:

+ +
+
{{domxref("document.contains")}}
+
As a work-around, document.body.contains() can be used.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("DOM WHATWG", "#interface-document", "Document")}}{{Spec2("DOM WHATWG")}}Intend to supersede DOM 3
{{SpecName("HTML WHATWG", "dom.html#the-document-object", "Document")}}{{Spec2("HTML WHATWG")}}Turn the {{domxref("HTMLDocument")}} interface into a Document extension.
{{SpecName("HTML Editing", "#dom-document-getselection", "Document")}}{{Spec2("HTML Editing")}}Extend the Document interface
{{SpecName("CSSOM View", "#extensions-to-the-document-interface", "Document")}}{{Spec2("CSSOM View")}}Extend the Document interface
{{SpecName("CSSOM", "#extensions-to-the-document-interface", "Document")}}{{Spec2("CSSOM")}}Extend the Document interface
{{SpecName("Pointer Lock", "#extensions-to-the-document-interface", "Document")}}{{Spec2("Pointer Lock")}}Extend the Document interface
{{SpecName("Page Visibility API", "#extensions-to-the-document-interface", "Document")}}{{Spec2("Page Visibility API")}}Extend the Document interface with the visibilityState and hidden attributes and the onvisibilitychange event listener.
{{SpecName("Selection API", "#extensions-to-document-interface", "Document")}}{{Spec2("Selection API")}}Adds getSelection(), onselectstart and onselectionchange.
{{SpecName("DOM4", "#interface-document", "Document")}}{{Spec2("DOM4")}}Supersede DOM 3
{{SpecName("DOM3 Core", "#i-Document", "Document")}}{{Spec2("DOM3 Core")}}Supersede DOM 2
{{SpecName("DOM3 XPath", "xpath.html#XPathEvaluator", "XPathEvaluator")}}{{Spec2("DOM3 XPath")}}Define the {{domxref("XPathEvaluator")}} interface which extend document.
{{SpecName("DOM2 Core", "#i-Document", "Document")}}{{Spec2("DOM2 Core")}}Supersede DOM 1
{{SpecName("DOM1", "#i-Document", "Document")}}{{Spec2("DOM1")}}Initial definition for the interface
+ +

Browser compatibility

+ + + +

{{Compat("api.Document")}}

+ +
{{APIRef}}
diff --git a/files/he/web/api/document/write/index.html b/files/he/web/api/document/write/index.html new file mode 100644 index 0000000000..8c497d548c --- /dev/null +++ b/files/he/web/api/document/write/index.html @@ -0,0 +1,82 @@ +--- +title: 'Document.write():' +slug: Web/API/Document/write +translation_of: Web/API/Document/write +--- +
{{ ApiRef("DOM") }}
+ +

()Document.write - כותב מחרוזת טקסט אל גוף מסמך HTML.

+ +

תחביר

+ +
document.write(markup);
+
+ +

פרמטרים

+ +
+
markup
+
מחרוזת המכילה את הטקסט שיופיע במסמך.
+
+ +

דוגמה

+ +
<html>
+
+<head>
+  <title>write example</title>
+
+  <script>
+    function newContent() {
+      alert("load new content");
+      document.open();
+      document.write("<h1>Out with the old - in with the new!</h1>");
+      document.close();
+    }
+  </script>
+</head>
+
+<body onload="newContent();">
+  <p>Some original document content.</p>
+</body>
+
+</html>
+
+
+ +

מפרט

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "#dom-document-write", "document.write(...)")}}{{Spec2("HTML WHATWG")}} 
{{SpecName("DOM2 HTML", "html.html#ID-75233634", "document.write(...)")}}{{Spec2("DOM2 HTML")}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Document.write")}}

+ +

ראה גם

+ + diff --git a/files/he/web/api/domstring/index.html b/files/he/web/api/domstring/index.html new file mode 100644 index 0000000000..210e3c86c0 --- /dev/null +++ b/files/he/web/api/domstring/index.html @@ -0,0 +1,50 @@ +--- +title: DOMString +slug: Web/API/DOMString +translation_of: Web/API/DOMString +--- +

{{APIRef("DOM")}}
+ מחרוזת DOMString הינה מחרוזות מסוג UTF-16.
+ כל מחרוזת בשפת JavaScript נחשבת למחרוזת UTF-16 ולכן, נחשבת ל-DOMString באופן אוטומטי.

+ +

מפרט

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebIDL', '#idl-DOMString', 'DOMString')}}{{Spec2('WebIDL')}}Rephrasing of the definition to remove weird edge cases.
{{SpecName('DOM3 Core', 'core.html#DOMString', 'DOMString')}}{{Spec2('DOM3 Core')}}No change from {{SpecName('DOM2 Core')}}
{{SpecName('DOM2 Core', 'core.html#ID-C74D1578', 'DOMString')}}{{Spec2('DOM2 Core')}}No change from {{SpecName('DOM1')}}
{{SpecName('DOM1', 'level-one-core.html#ID-C74D1578', 'DOMString')}}{{Spec2('DOM1')}}Initial definition.
+ +

ראו גם 

+ + diff --git a/files/he/web/api/element/index.html b/files/he/web/api/element/index.html new file mode 100644 index 0000000000..a0d4f8ee21 --- /dev/null +++ b/files/he/web/api/element/index.html @@ -0,0 +1,331 @@ +--- +title: Element +slug: Web/API/Element +tags: + - API + - DOM + - DOM Reference + - Element + - Interface + - NeedsTranslation + - Reference + - TopicStub + - Web API +translation_of: Web/API/Element +--- +
{{APIRef("DOM")}}
+ +

Element is the most general base class from which all objects in a {{DOMxRef("Document")}} inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. For example, the {{DOMxRef("HTMLElement")}} interface is the base interface for HTML elements, while the {{DOMxRef("SVGElement")}} interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy.

+ +

Languages outside the realm of the Web platform, like XUL through the XULElement interface, also implement Element.

+ +

{{InheritanceDiagram}}

+ +

Properties

+ +

Inherits properties from its parent interface, {{DOMxRef("Node")}}, and by extension that interface's parent, {{DOMxRef("EventTarget")}}. It implements the properties of {{DOMxRef("ParentNode")}}, {{DOMxRef("ChildNode")}}, {{DOMxRef("NonDocumentTypeChildNode")}}, and {{DOMxRef("Animatable")}}.

+ +
+
{{DOMxRef("Element.attributes")}} {{readOnlyInline}}
+
Returns a {{DOMxRef("NamedNodeMap")}} object containing the assigned attributes of the corresponding HTML element.
+
{{DOMxRef("Element.classList")}} {{readOnlyInline}}
+
Returns a {{DOMxRef("DOMTokenList")}} containing the list of class attributes.
+
{{DOMxRef("Element.className")}}
+
Is a {{DOMxRef("DOMString")}} representing the class of the element.
+
{{DOMxRef("Element.clientHeight")}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the inner height of the element.
+
{{DOMxRef("Element.clientLeft")}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the width of the left border of the element.
+
{{DOMxRef("Element.clientTop")}}  {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the width of the top border of the element.
+
{{DOMxRef("Element.clientWidth")}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the inner width of the element.
+
{{DOMxRef("Element.computedName")}} {{readOnlyInline}}
+
Returns a {{DOMxRef("DOMString")}} containing the label exposed to accessibility.
+
{{DOMxRef("Element.computedRole")}} {{readOnlyInline}}
+
Returns a {{DOMxRef("DOMString")}} containing the ARIA role that has been applied to a particular element. 
+
{{DOMxRef("Element.id")}}
+
Is a {{DOMxRef("DOMString")}} representing the id of the element.
+
{{DOMxRef("Element.innerHTML")}}
+
Is a {{DOMxRef("DOMString")}} representing the markup of the element's content.
+
{{DOMxRef("Element.localName")}} {{readOnlyInline}}
+
A {{DOMxRef("DOMString")}} representing the local part of the qualified name of the element.
+
{{DOMxRef("Element.namespaceURI")}} {{readonlyInline}}
+
The namespace URI of the element, or null if it is no namespace. +
+

Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the http://www.w3.org/1999/xhtml namespace in both HTML and XML trees. {{ gecko_minversion_inline("1.9.2")}}

+
+
+
{{DOMxRef("NonDocumentTypeChildNode.nextElementSibling")}} {{readOnlyInline}}
+
Is an {{DOMxRef("Element")}}, the element immediately following the given one in the tree, or null if there's no sibling node.
+
{{DOMxRef("Element.outerHTML")}}
+
Is a {{DOMxRef("DOMString")}} representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
+
{{DOMxRef("Element.prefix")}} {{readOnlyInline}}
+
A {{DOMxRef("DOMString")}} representing the namespace prefix of the element, or null if no prefix is specified.
+
{{DOMxRef("NonDocumentTypeChildNode.previousElementSibling")}} {{readOnlyInline}}
+
Is a {{DOMxRef("Element")}}, the element immediately preceding the given one in the tree, or null if there is no sibling element.
+
{{DOMxRef("Element.scrollHeight")}}  {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the scroll view height of an element.
+
{{DOMxRef("Element.scrollLeft")}}
+
Is a {{jsxref("Number")}} representing the left scroll offset of the element.
+
{{DOMxRef("Element.scrollLeftMax")}} {{Non-standard_Inline}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the maximum left scroll offset possible for the element.
+
{{DOMxRef("Element.scrollTop")}}
+
A {{jsxref("Number")}} representing number of pixels the top of the document is scrolled vertically.
+
{{DOMxRef("Element.scrollTopMax")}} {{Non-standard_Inline}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the maximum top scroll offset possible for the element.
+
{{DOMxRef("Element.scrollWidth")}} {{readOnlyInline}}
+
Returns a {{jsxref("Number")}} representing the scroll view width of the element.
+
{{DOMxRef("Element.shadowRoot")}}{{readOnlyInline}}
+
Returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
+
{{DOMxRef("Element.openOrClosedShadowRoot")}} {{Non-standard_Inline}}{{readOnlyInline}}
+
Returns the shadow root that is hosted by the element, regardless if its open or closed. Available only to WebExtensions.
+
{{DOMxRef("Element.slot")}} {{Experimental_Inline}}
+
Returns the name of the shadow DOM slot the element is inserted in.
+
{{DOMxRef("Element.tabStop")}} {{Non-standard_Inline}}
+
Is a {{jsxref("Boolean")}} indicating if the element can receive input focus via the tab key.
+
{{DOMxRef("Element.tagName")}} {{readOnlyInline}}
+
Returns a {{jsxref("String")}} with the name of the tag for the given element.
+
{{DOMxRef("Element.undoManager")}} {{Experimental_Inline}} {{readOnlyInline}}
+
Returns the {{DOMxRef("UndoManager")}} associated with the element.
+
{{DOMxRef("Element.undoScope")}} {{Experimental_Inline}}
+
Is a {{jsxref("Boolean")}} indicating if the element is an undo scope host, or not.
+
+ +
+

Note: DOM Level 3 defined namespaceURI, localName and prefix on the {{DOMxRef("Node")}} interface. In DOM4 they were moved to Element.

+ +

This change is implemented in Chrome since version 46.0 and Firefox since version 48.0.

+
+ +

Properties included from Slotable

+ +

The Element interface includes the following property, defined on the {{DOMxRef("Slotable")}} mixin.

+ +
+
{{DOMxRef("Slotable.assignedSlot")}}{{readonlyInline}}
+
Returns a {{DOMxRef("HTMLSlotElement")}} representing the {{htmlelement("slot")}} the node is inserted in.
+
+ +

Event handlers

+ +
+
{{domxref("Element.onfullscreenchange")}}
+
An event handler for the {{event("fullscreenchange")}} event, which is sent when the element enters or exits full-screen mode. This can be used to watch both for successful expected transitions, but also to watch for unexpected changes, such as when your app is backgrounded.
+
{{domxref("Element.onfullscreenerror")}}
+
An event handler for the {{event("fullscreenerror")}} event, which is sent when an error occurs while attempting to change into full-screen mode.
+
+ +

Obsolete event handlers

+ +
+
{{DOMxRef("Element.onwheel")}}
+
Returns the event handling code for the {{Event("wheel")}} event. This is now implemented on {{DOMxRef("GlobalEventHandlers.onwheel", "GlobalEventHandlers")}}.
+
+ +

Methods

+ +

Inherits methods from its parents {{DOMxRef("Node")}}, and its own parent, {{DOMxRef("EventTarget")}}, and implements those of {{DOMxRef("ParentNode")}}, {{DOMxRef("ChildNode")}}, {{DOMxRef("NonDocumentTypeChildNode")}}, and {{DOMxRef("Animatable")}}.

+ +
+
{{DOMxRef("EventTarget.addEventListener()")}}
+
Registers an event handler to a specific event type on the element.
+
{{DOMxRef("Element.attachShadow()")}}
+
Attatches a shadow DOM tree to the specified element and returns a reference to its {{DOMxRef("ShadowRoot")}}.
+
{{DOMxRef("Element.animate()")}} {{Experimental_Inline}}
+
A shortcut method to create and run an animation on an element. Returns the created Animation object instance.
+
{{DOMxRef("Element.closest()")}} {{Experimental_Inline}}
+
Returns the {{DOMxRef("Element")}} which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter.
+
{{DOMxRef("Element.createShadowRoot()")}} {{Non-standard_Inline}} {{Deprecated_Inline}}
+
Creates a shadow DOM on on the element, turning it into a shadow host. Returns a {{DOMxRef("ShadowRoot")}}.
+
{{DOMxRef("Element.computedStyleMap()")}} {{Experimental_Inline}}
+
Returns a {{DOMxRef("StylePropertyMapReadOnly")}} interface which provides a read-only representation of a CSS declaration block that is an alternative to {{DOMxRef("CSSStyleDeclaration")}}.
+
{{DOMxRef("EventTarget.dispatchEvent()")}}
+
Dispatches an event to this node in the DOM and returns a {{jsxref("Boolean")}} that indicates whether no handler canceled the event.
+
{{DOMxRef("Element.getAnimations()")}} {{Experimental_Inline}}
+
Returns an array of Animation objects currently active on the element.
+
{{DOMxRef("Element.getAttribute()")}}
+
Retrieves the value of the named attribute from the current node and returns it as an {{jsxref("Object")}}.
+
{{DOMxRef("Element.getAttributeNames()")}}
+
Returns an array of attribute names from the current element.
+
{{DOMxRef("Element.getAttributeNS()")}}
+
Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an {{jsxref("Object")}}.
+
{{DOMxRef("Element.getAttributeNode()")}} {{Obsolete_Inline}}
+
Retrieves the node representation of the named attribute from the current node and returns it as an {{DOMxRef("Attr")}}.
+
{{DOMxRef("Element.getAttributeNodeNS()")}} {{Obsolete_Inline}}
+
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an {{DOMxRef("Attr")}}.
+
{{DOMxRef("Element.getBoundingClientRect()")}}
+
Returns the size of an element and its position relative to the viewport.
+
{{DOMxRef("Element.getClientRects()")}}
+
Returns a collection of rectangles that indicate the bounding rectangles for each line of text in a client.
+
{{DOMxRef("Element.getElementsByClassName()")}}
+
Returns a live {{DOMxRef("HTMLCollection")}} that contains all descendants of the current element that possess the list of classes given in the parameter.
+
{{DOMxRef("Element.getElementsByTagName()")}}
+
Returns a live {{DOMxRef("HTMLCollection")}} containing all descendant elements, of a particular tag name, from the current element.
+
{{DOMxRef("Element.getElementsByTagNameNS()")}}
+
Returns a live {{DOMxRef("HTMLCollection")}} containing all descendant elements, of a particular tag name and namespace, from the current element.
+
{{DOMxRef("Element.hasAttribute()")}}
+
Returns a {{jsxref("Boolean")}} indicating if the element has the specified attribute or not.
+
{{DOMxRef("Element.hasAttributeNS()")}}
+
Returns a {{jsxref("Boolean")}} indicating if the element has the specified attribute, in the specified namespace, or not.
+
{{DOMxRef("Element.hasAttributes()")}}
+
Returns a {{jsxref("Boolean")}} indicating if the element has one or more HTML attributes present.
+
{{DOMxRef("Element.hasPointerCapture()")}}
+
Indicates whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID.
+
{{DOMxRef("Element.insertAdjacentElement()")}}
+
Inserts a given element node at a given position relative to the element it is invoked upon.
+
{{DOMxRef("Element.insertAdjacentHTML()")}}
+
Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.
+
{{DOMxRef("Element.insertAdjacentText()")}}
+
Inserts a given text node at a given position relative to the element it is invoked upon.
+
{{DOMxRef("Element.matches()")}} {{Experimental_Inline}}
+
Returns a {{jsxref("Boolean")}} indicating whether or not the element would be selected by the specified selector string.
+
{{DOMxRef("Element.querySelector()")}}
+
Returns the first {{DOMxRef("Node")}} which matches the specified selector string relative to the element.
+
{{DOMxRef("Element.querySelectorAll()")}}
+
Returns a {{DOMxRef("NodeList")}} of nodes which match the specified selector string relative to the element.
+
{{DOMxRef("Element.releasePointerCapture()")}}
+
Releases (stops) pointer capture that was previously set for a specific {{DOMxRef("PointerEvent","pointer event")}}.
+
{{DOMxRef("ChildNode.remove()")}} {{Experimental_Inline}}
+
Removes the element from the children list of its parent.
+
{{DOMxRef("Element.removeAttribute()")}}
+
Removes the named attribute from the current node.
+
{{DOMxRef("Element.removeAttributeNS()")}}
+
Removes the attribute with the specified name and namespace, from the current node.
+
{{DOMxRef("Element.removeAttributeNode()")}} {{Obsolete_Inline}}
+
Removes the node representation of the named attribute from the current node.
+
{{DOMxRef("EventTarget.removeEventListener()")}}
+
Removes an event listener from the element.
+
{{DOMxRef("Element.requestFullscreen()")}} {{Experimental_Inline}}
+
Asynchronously asks the browser to make the element full-screen.
+
{{DOMxRef("Element.requestPointerLock()")}} {{Experimental_Inline}}
+
Allows to asynchronously ask for the pointer to be locked on the given element.
+
+ +
+
{{domxref("Element.scroll()")}}
+
Scrolls to a particular set of coordinates inside a given element.
+
{{domxref("Element.scrollBy()")}}
+
Scrolls an element by the given amount.
+
{{DOMxRef("Element.scrollIntoView()")}} {{Experimental_Inline}}
+
Scrolls the page until the element gets into the view.
+
{{domxref("Element.scrollTo()")}}
+
Scrolls to a particular set of coordinates inside a given element.
+
{{DOMxRef("Element.setAttribute()")}}
+
Sets the value of a named attribute of the current node.
+
{{DOMxRef("Element.setAttributeNS()")}}
+
Sets the value of the attribute with the specified name and namespace, from the current node.
+
{{DOMxRef("Element.setAttributeNode()")}} {{Obsolete_Inline}}
+
Sets the node representation of the named attribute from the current node.
+
{{DOMxRef("Element.setAttributeNodeNS()")}} {{Obsolete_Inline}}
+
Sets the node representation of the attribute with the specified name and namespace, from the current node.
+
{{DOMxRef("Element.setCapture()")}} {{Non-standard_Inline}}
+
Sets up mouse event capture, redirecting all mouse events to this element.
+
{{DOMxRef("Element.setPointerCapture()")}}
+
Designates a specific element as the capture target of future pointer events.
+
{{DOMxRef("Element.toggleAttribute()")}}
+
Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Web Animations", '', '')}}{{Spec2("Web Animations")}}Added the getAnimations() method.
{{SpecName('Undo Manager', '', 'Element')}}{{Spec2('Undo Manager')}}Added the undoScope and undoManager properties.
{{SpecName('Pointer Events 2', '#extensions-to-the-element-interface', 'Element')}}{{Spec2('Pointer Events 2')}}Added the following event handlers: ongotpointercapture and onlostpointercapture.
+ Added the following methods: setPointerCapture() and releasePointerCapture().
{{SpecName('Pointer Events', '#extensions-to-the-element-interface', 'Element')}}{{Spec2('Pointer Events')}}Added the following event handlers: ongotpointercapture and onlostpointercapture.
+ Added the following methods: setPointerCapture() and releasePointerCapture().
{{SpecName('Selectors API Level 1', '#interface-definitions', 'Element')}}{{Spec2('Selectors API Level 1')}}Added the following methods: querySelector() and querySelectorAll().
{{SpecName('Pointer Lock', 'index.html#element-interface', 'Element')}}{{Spec2('Pointer Lock')}}Added the requestPointerLock() method.
{{SpecName('Fullscreen', '#api', 'Element')}}{{Spec2('Fullscreen')}}Added the requestFullscreen() method.
{{SpecName('DOM Parsing', '#extensions-to-the-element-interface', 'Element')}}{{Spec2('DOM Parsing')}}Added the following properties: innerHTML, and outerHTML.
+ Added the following method: insertAdjacentHTML().
{{SpecName('CSSOM View', '#extensions-to-the-element-interface', 'Element')}}{{Spec2('CSSOM View')}}Added the following properties: scrollTop, scrollLeft, scrollWidth, scrollHeight, clientTop, clientLeft, clientWidth, and clientHeight.
+ Added the following methods: getClientRects(), getBoundingClientRect(), scroll()scrollBy(), scrollTo() and scrollIntoView().
{{SpecName('Element Traversal', '#ecmascript-bindings', 'Element')}}{{Spec2('Element Traversal')}}Added inheritance of the {{DOMxRef("ElementTraversal")}} interface.
{{SpecName('DOM WHATWG', '#interface-element', 'Element')}}{{Spec2('DOM WHATWG')}}Added the following methods: closest(), insertAdjacentElement() and insertAdjacentText().
+ Moved hasAttributes() from the Node interface to this one.
{{SpecName("DOM4", "#interface-element", "Element")}}{{Spec2("DOM4")}}Removed the following methods: setIdAttribute(), setIdAttributeNS(), and setIdAttributeNode().
+ Modified the return value of getElementsByTagName() and getElementsByTagNameNS().
+ Removed the schemaTypeInfo property.
{{SpecName('DOM3 Core', 'core.html#ID-745549614', 'Element')}}{{Spec2('DOM3 Core')}}Added the following methods: setIdAttribute(), setIdAttributeNS(), and setIdAttributeNode(). These methods were never implemented and have been removed in later specifications.
+ Added the schemaTypeInfo property. This property was never implemented and has been removed in later specifications.
{{SpecName('DOM2 Core', 'core.html#ID-745549614', 'Element')}}{{Spec2('DOM2 Core')}}The normalize() method has been moved to {{DOMxRef("Node")}}.
{{SpecName('DOM1', 'level-one-core.html#ID-745549614', 'Element')}}{{Spec2('DOM1')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.Element")}}

diff --git a/files/he/web/api/geolocation/index.html b/files/he/web/api/geolocation/index.html new file mode 100644 index 0000000000..e69c21503d --- /dev/null +++ b/files/he/web/api/geolocation/index.html @@ -0,0 +1,109 @@ +--- +title: Geolocation +slug: Web/API/Geolocation +tags: + - API + - Advanced + - Geolocation API + - Interface + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/API/Geolocation +--- +
+ {{APIRef}}
+

The Geolocation interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app offer customized results based on the user's location.

+

An object with this interface is obtained using the {{domxref("NavigatorGeolocation.geolocation")}} property implemented by the {{domxref("Navigator")}} object.

+
+

Note: For security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission.

+
+

Properties

+

The Geolocation interface neither implements, nor inherit any property.

+

Methods

+

The Geolocation interface doesn't inherit any method.

+
+
+ {{domxref("Geolocation.getCurrentPosition()")}}
+
+ Determines the device's current location and gives back a {{domxref("Position")}} object with the data.
+
+ {{domxref("Geolocation.watchPosition()")}}
+
+ Returns a long value representing the newly established callback function to be invoked whenever the device location changes.
+
+ {{domxref("Geolocation.clearWatch()")}}
+
+ Removes the particular handler previously installed using watchPosition().
+
+

Specifications

+ + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Geolocation')}}{{Spec2('Geolocation')}}Initial specification.
+

Browser compatibility

+

{{ CompatibilityTable() }}

+
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support5{{CompatGeckoDesktop("1.9.1")}}910.60
+ Removed in 15.0
+ Reintroduced in 16.0
5
+
+
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown()}}{{CompatUnknown()}}{{CompatGeckoMobile("4")}}{{CompatUnknown()}}10.60{{CompatUnknown()}}
+
+

See also

+ diff --git "a/files/he/web/api/geolocation/\327\236\327\236\327\251\327\247_\327\251\327\231\327\250\327\225\327\252\327\231_\327\236\327\231\327\247\327\225\327\235/index.html" "b/files/he/web/api/geolocation/\327\236\327\236\327\251\327\247_\327\251\327\231\327\250\327\225\327\252\327\231_\327\236\327\231\327\247\327\225\327\235/index.html" new file mode 100644 index 0000000000..f87dbb0f0b --- /dev/null +++ "b/files/he/web/api/geolocation/\327\236\327\236\327\251\327\247_\327\251\327\231\327\250\327\225\327\252\327\231_\327\236\327\231\327\247\327\225\327\235/index.html" @@ -0,0 +1,250 @@ +--- +title: ממשק שירותי מיקום +slug: Web/API/Geolocation/ממשק_שירותי_מיקום +translation_of: Web/API/Geolocation_API +--- +

ממשק שירותי המיקום, geolocation API, מאפשר למשתמש לשתף את המיקום שלו עם אפליקציות ברשת. כדי להגן על הפרטיות, המשתמש נדרש להסכים לשתף את שירותי המיקום שלו.

+

אובייקט ה- geolocation 

+

ממשק שירותי המיקום נגיש באמצעות אובייקט:{{domxref("window.navigator.geolocation","navigator.geolocation")}} .

+

אם האובייקט קיים, ממשק שירותי המיקום נתמך: ניתן לבדוק אם ממשק שירותי המיקום נתמך באמצעות: 

+
if ("geolocation" in navigator) {
+  /* הממשק נתמך*/
+} else {
+  /* הממשק אינו נתמך */
+}הערה
+
+
+

הערה: מגרסה מס' 24 של FireFox ומטה, הפקודה geolocation" in navigator" מחזירה true אפילו אם הממשק אינו נתמך. באג זה תוקן בגרסה 25 של FireFox על מנת לעמוד בתקן. ({{bug(884921)}}).

+
+

קבלת המיקום הנוכחי

+

כדי לקבל את נתוני המיקום הנוכחי של המשתמש, ניתן לקרוא לפונקציה:  {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}}. הפונקציה יוצרת קריאה אסינכרונית על מנת לאחזר את המיקום של המשתמש ובודקת את החומרה על מנת לקבל את המיקום העדכני ביותר. כאשר נתוני המיקום חוזרים כתוצאה מהקריאה, פונקציית המטרה (באנגלית: callback) נקראת. אפשר להעביר לקריאה פרמטר נוסף, פרמטר שני: פונקציית מטרה לטיפול במיקרה של שגיאה. אפשר להעביר פרמטר שלישי לקריאה: אובייקט options שבו אפשר להגדיר מהו הוותק המכסימלי לערכי המיקום המוחזרים, משך הזמן המכסימלי להמתנה עד שנתוני המיקום יתקבלו ורמת הדיוק של נתוני המיקום. 

+
+

הערה: כברירת מחדל, הפונקציה, {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}} מנסה להחזיר את נתוני המיקום במהירות האפשרית, אך ברמת דיוק מינימלית. צורה זו שימושית אם רוצים לקבל את הנתונים במהירות הגבוהה האפשרית תוך התפשרות על רמת הדיוק. במכשירים עם מנגנון GPS משך הזמן לקבלת נתונים יכול לקחת דקה ויותר, לכן הפונקציה  {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}} יכולה לקבל בחזרה נתונים שיש בהם מידה מסוימת של שגיאה (אם המיקום חושב על בסיס כתובת IP על בסיס מיקום נקודת wifi).

+
+
navigator.geolocation.getCurrentPosition(function(position) {
+  do_something(position.coords.latitude, position.coords.longitude);
+});
+

הקוד בדוגמא שלעיל יגרום לפונקצייה, ()do_something, להתבצע כאשר נתוני המיקום חזרו.

+

 

+

מעקב אחר המיקום הנוכחי

+

אם נתוני המיקום משתנים (בגלל שהדפדפן נמצא בתנועה, או אם הגיעו נתוני מיקום מדוייקים יותר), אפשר להגדיר פונקציית מטרה (באנגלית: callback), המקבלת נתוני מיקום מעודכנים יותר. עושים זאת באמצעות הפונקציה: {{domxref("window.navigator.geolocation.watchPosition()","watchPosition()")}} שיש לה את אותם פרמטרים כמו הפונקציה:  {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}}. פונקציית המטרה מתבצעת מס' כלשהו של פעמים ומאפשרת לדפדפן לעדכן את המיקום של המשתמש תוך כדי תנועה, או לעדכן את מיקומו בנתונים מעודכנים יותר שהגיעו על ידי טכניקות זיהוי מיקום מדוייקות יותר. ניתן להגדיר פונקציית מטרה נוספת למקרה של שגיאה שתיקרא בכל פעם שתתרחש שגיאה כפי שקורה במיקרה של:  {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}}.

+
+

הערה: ניתן להשתמש בפונקציה: {{domxref("window.navigator.geolocation.watchPosition()","watchPosition()")}} מבלי צורך לקרוא לפני כן לפונקציה: {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}} .

+
+
var watchID = navigator.geolocation.watchPosition(function(position) {
+  do_something(position.coords.latitude, position.coords.longitude);
+});
+

הפונקציה {{domxref("window.navigator.geolocation.watchPosition()","watchPosition()")}} מחזירה id שמזהה את הפונקציה שעוקבת אחר המיקום. ניתן לאחר מכן להשתמש בו כדי לקרוא לפונקציה  {{domxref("window.navigator.geolocation.clearWatch()","clearWatch()")}} על מנת להפסיק את פעולת המעקב אחרי תנועת המשתמש.

+
navigator.geolocation.clearWatch(watchID);
+
+

כיול התוצאות

+

הן הפונקציה {{domxref("window.navigator.geolocation.getCurrentPosition()","getCurrentPosition()")}} והן הפונקציה {{domxref("window.navigator.geolocation.watchPosition()","watchPosition()")}} מקבלות פרמטר פונקציית מטרה למקרה הצלחה בקבלת נתונים, מקבלות פרמטר אופציונאלי למקרה של שגיאה בקבלת נתוני מיקום ופרמטר אופציונאלי שלישי: אובייקט  PositionOptions.

+

{{page("/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition","PositionOptions")}}

+

קריאה ל: {{domxref("window.navigator.geolocation.watchPosition()","watchPosition")}} יכולה להיראות כך:

+
function geo_success(position) {
+  do_something(position.coords.latitude, position.coords.longitude);
+}
+
+function geo_error() {
+  alert("Sorry, no position available.");
+}
+
+var geo_options = {
+  enableHighAccuracy: true,
+  maximumAge        : 30000,
+  timeout           : 27000
+};
+
+var wpid = navigator.geolocation.watchPosition(geo_success, geo_error, geo_options);
+

A demo of watchPosition in use: http://www.thedotproduct.org/experiments/geo/
+ 

+

נתוני המיקום

+

המיקום של המשתמש הוא אובייקט Position שמכיל בתוכו אובייקט Coordinates.

+

{{page("/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition","Position")}}

+

{{page("/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition","Coordinates")}}

+

טיפול בשגיאות

+

פונקציית המטרה לטיפול בשגיאות נגישה גם בקריאה לפונקציה ()getCurrentPosition וגם בקריאה ל ()watchPositionומקבלת כפרמטר ראשון אובייקט PositionError

+
function errorCallback(error) {
+  alert('ERROR(' + error.code + '): ' + error.message);
+};
+
+

{{page("/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition","PositionError")}}

+

דוגמא שלמה לממשק שירותי מיקום

+ +

HTML: 

+
<p><button onclick="geoFindMe()">Show my location</button></p>
+<div id="out"></div>
+
+

JavaScript:

+
function geoFindMe() {
+  var output = document.getElementById("out");
+
+  if (!navigator.geolocation){
+    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
+    return;
+  }
+
+  function success(position) {
+    var latitude  = position.coords.latitude;
+    var longitude = position.coords.longitude;
+
+    output.innerHTML = '<p>Latitude is ' + latitude + '° <br>Longitude is ' + longitude + '°</p>';
+
+    var img = new Image();
+    img.src = "http://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false";
+
+    output.appendChild(img);
+  };
+
+  function error() {
+    output.innerHTML = "Unable to retrieve your location";
+  };
+
+  output.innerHTML = "<p>Locating…</p>";
+
+  navigator.geolocation.getCurrentPosition(success, error);
+}
+
+

תוצאות של הדוגמא לעיל:

+

{{ EmbedLiveSample('Geolocation_Live_Example',350,410) }}

+

הצגת הודעה לבקשת רשות

+

כל תוסף המשתייך ל addons.mozilla.org המשתמש בממשק שירותי המיקום חייב לקבל אישור מהמשתמש לגשת לממשק על ידי בקשת רשות מפורשת. הפונקציה הבאה תבקש אישור באופן שזהה לבקשת האישור המוצגת לדפים ברשת. הבחירה של המשתמש תישמר בהעדפות באמצעות פרמטר pref או הוא מאופשר. הפונקציה המוצבעת על ידי פרמטר callback תיקרא עם פרמטר בוליאני המציין את בחירת המשתמש. אם הערך true יש לתוסף הרשאה לגשת לנתוני המיקום. 

+
function prompt(window, pref, message, callback) {
+    let branch = Components.classes["@mozilla.org/preferences-service;1"]
+                           .getService(Components.interfaces.nsIPrefBranch);
+
+    if (branch.getPrefType(pref) === branch.PREF_STRING) {
+        switch (branch.getCharPref(pref)) {
+        case "always":
+            return callback(true);
+        case "never":
+            return callback(false);
+        }
+    }
+
+    let done = false;
+
+    function remember(value, result) {
+        return function() {
+            done = true;
+            branch.setCharPref(pref, value);
+            callback(result);
+        }
+    }
+
+    let self = window.PopupNotifications.show(
+        window.gBrowser.selectedBrowser,
+        "geolocation",
+        message,
+        "geo-notification-icon",
+        {
+            label: "Share Location",
+            accessKey: "S",
+            callback: function(notification) {
+                done = true;
+                callback(true);
+            }
+        }, [
+            {
+                label: "Always Share",
+                accessKey: "A",
+                callback: remember("always", true)
+            },
+            {
+                label: "Never Share",
+                accessKey: "N",
+                callback: remember("never", false)
+            }
+        ], {
+            eventCallback: function(event) {
+                if (event === "dismissed") {
+                    if (!done) callback(false);
+                    done = true;
+                    window.PopupNotifications.remove(self);
+                }
+            },
+            persistWhileVisible: true
+        });
+}
+
+prompt(window,
+       "extensions.foo-addon.allowGeolocation",
+       "Foo Add-on wants to know your location.",
+       function callback(allowed) { alert(allowed); });
+
+

תאימות דפדפנים

+
+ {{ CompatibilityTable() }}
+
+  
+
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support5{{CompatGeckoDesktop("1.9.1")}}910.60
+ Removed in 15.0
+ Reintroduced in 16.0
5
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown()}}{{CompatUnknown()}}{{CompatGeckoMobile("4")}}1.0.1{{CompatUnknown()}}10.60
+ Removed in 15.0
+ Reintroduced in 16.0
{{CompatUnknown()}}
+
+

הערות לגבי Gecko

+

דפדפן FireFox תומך בקבלת נתוני המיקום בהתבסס על מידע WiFi באמצעות שירותי המיקום של גוגל. בטרנזאקציה שבין FireFox ל Google, המידע שמועבר כולל מידע על נקודת הגישה ל WiFi, כולל access token (שדומה לcookie בעלת תוקף למשך שבועיים) וכולל את כתובת ה IP של המשתמש. למידע נוסף יש התעדכן בתנאי הפרטיות של Mozilla ובתנאי הפרטיות של גוגל המפרטים באיזה אופן נתונים אלה ניתנים לשימוש. 

+

FireFox גרסת 3.6 (Gecko 1.9.2) הוסיף תמיכה לשימוש בשירות GPSD (GPS daemon) בשביל שירותי מיקום עבור Linux. 

+

לעיון נוסף

+ diff --git a/files/he/web/api/index.html b/files/he/web/api/index.html new file mode 100644 index 0000000000..83cde65af8 --- /dev/null +++ b/files/he/web/api/index.html @@ -0,0 +1,38 @@ +--- +title: Web API Interfaces +slug: Web/API +tags: + - API + - Apps + - JavaScript + - Landing + - Reference + - Web + - WebAPI +translation_of: Web/API +--- +

כשאתה כותב קוד עבור ה-Web, יש הרבה Web APIs זמינים. להלן רשימה של כל ה-APIs והממשקים (טיפוסי עצמים) בהם תוכל להשתמש בעת פיתוח אפליקציית ה-Web או האתר שלך.

+ +
בדרך כלל משתמשים ב-Web APIs עם JavaScript, אם כי זה לא תמיד חייב להיות כך.
+ +
+ +

מפרטים

+ +

זו רשימת כל ה-APIs הזמינים.

+ +

{{ListGroups}}

+ +

ממשקים

+ +

זו רשימת כל הממשקים (זאת אומרת, טיפוסים של עצמים) הזמינים.

+ +

{{APIListAlpha}}

+ +

ראה גם

+ + + + diff --git a/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html b/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html new file mode 100644 index 0000000000..094ee01378 --- /dev/null +++ b/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html @@ -0,0 +1,141 @@ +--- +title: מגבלות האחסנה של הדפדפן וקריטריונים לפינוי +slug: Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria +tags: + - Database + - IndexedDB + - LRU + - אחסנה + - בדיס נתונים + - מגבלה + - פינוי + - צד הלקוח +translation_of: Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria +--- +
{{DefaultAPISidebar("IndexedDB")}}
+ +
קיימות מספר טכנולוגיות רשת המאחסנות נתונים מסוג זה או אחר בצד הלקוח (כלומר, על הדיסק המקומי שלך). התהליך בו הדפדפן מחשב כמה מקום להקצות לאחסנת מידע רשת ומה למחוק כאשר מגיעים לגבול אינו פשוט, ונבדל בין דפדפנים.
+ +
מאמר זה מתאר איך דפדפנים מכריעים איזה תוכן מקומי לטהר, ומתי בסדר לשחרר חלל אחסנה מקומי.
+ +

+ +
+

לתשומת לבך: המידע שלהלן אמור להיות מדוייק במידה מספקת עבור רוב הדפדפנים המודרניים, אך פרטי דפדפן נקראים כאשר ידועים. אופרה וכרום צריכים לפעול באותה דרך בכל המקרים, Opera Mini (תצוגת צד שרת, שעדיין מבוסס על תגובה מהירה) אינו מאחסן כל נתונים שהם בצד הלדוח.

+
+ +

אלו טכנולוגיות משתמשות באחסנת הנתונים של הדפדפן?

+ +

בפיירפוקס, הטכנולוגיות הבאות עושות שימוש באחסנת הנתונים של הדפדפן לאחסן נתונים כאשר יש צורך.  הגדרנו עבורם את המושג "לקוחות מכסה" בהקשר זה:

+ + + +
+

לתשומת לבך: בפיירפוקס, אחסנת הרשת בקרוב תתחיל להשתמש גם היא באותם כלי ניהול שטחי אחסון , כמתואר במסמך זה.

+
+ +
+

לתשומת לבך: במצב גלישה פרטית, רוב אחסנת המידע אינה נתמכת. נתוני אחסון מקומיים ועוגיות עדיין מאוחסנים, אך הם ארעיים - הנתונים נמחקים כאשר סוגרים את חלון אך הם ארעיים — הנתונים נמחקים עם סגירת חלון הגלישה הפרטית האחרון.

+
+ +

"זמן הגישה האחרון" של מקורות מתעדכן כאשר כל אחד מאלה מופעל/מושבת  — פינוי מקורות ימח' נתונים עבור כל לקוחות המכסה.

+ +

בכרום/אופרה, ממשק פיתוח היישומים של ניהול המכסות מטפל בניהול עבור  AppCache, IndexedDB, WebSQL, ו-File System API.

+ +

טיפוסים שונים של אחסנת נתונים

+ +

גם באותו הדפדפן, שימוש באותה שיטת אחסון, קיינות מחלקות שונות של אחסנת נתונים להבין. פרק זה ידון במפר מהם שייתכן ויימצאו בדפדפנים שונים.

+ +

אחסנה מופיעה במספר טיפוסים:

+ + + +

בפיירפוקס, כשאשר נעשה שימוש באחסנה קבועה,, ניתן למשתמש/ת חלון ממשק משתמש קופץ להתריע לו/ה כי הנתונים יישמרו, ובחלון תישאל השאלה אם המשתמש/ת מסכים/ה לכך.  אחסנת נתונים זמנית אינה מעוררת כל פנייה למשתמש/ת.

+ +

כברירת מחדל האחסנה היא זמנית; מפתחים יכולים לבחור להשתמש באחסנה קבועה לאתרים שלהם באמצעות השיטה  {{domxref("StorageManager.persist()")}} הזמינה ב-Storage API.

+ +

היכן מאוחסנים הנתונים?

+ +

כל טיפוס אחסנה מייצג מאגר נפרד. להלן המיפוי האקטואלי ל,תיקיות תחת פרופיל הפיירפוקס של  המשתמש/ת (דפדפנים אחרים עשויים להיות מעט שונים):

+ + + +
+
+

לתשומת לבך: אחרי שהוצג ה Storage API, התיקייה "permanent" יכולה להיחשב  מיושנת; התיקייה  "permanent" מאחסנת רק את בסיסי הנתונים מהטיפוס הקבוע IndexedDB. לא משנה אם מצב התיבה הוא  "best-effort" או "persistent" — נתונים   נשמרים תחת <profile>/storage/default.

+
+
+ +
+

לתשומת לבך: בפיירפוקס , ניתן למצוא את תיקיית הפרופיל שלך על ידי הכנסת  about:support בשורת ה- URL , ולחיצה על הכפתור  פתיחת ספרייה  (למשל Show ב- Finder על Mac OS X) על יד הכותרת Profile Folder .

+
+ +
+

לתשומת לבך: אם תחפשו במידע השמור בתיקיית הפרופיל , ייתכן שתמצאו תיקייה רביעית:: persistent. בעיקרות, שמה של התיקייה persistent שונה ל-permanent בשלב מסויים בעבר  כדי ששדרוגים/מעברים יהיו פשוטים לביצוע.

+
+ +
+

לתשומת לבך: אל למשתמשים להוסיף תיקיות וקבצים משלהם תחת  <profile>/storage. זה יגרום לאתחולי אחסנה להיכשל; לדוגמא, {{domxref("IDBFactory.open()", "open()")}} יגרום לאירוע שגיאה.

+
+ +

מגבלות האחסנה

+ +

שטח האחסנה המירבי של הדפדפן הוא דינמי — הוא מבוסס על גודל הדיסק הקשיח.  הגבול הגלובלי מחושב כ-50% מהשטח הפנוי על הדיסק. בפיירפוקס, כלי פנימי של הדפדפן הקרוי   Quota Manager כוקב אחרי גודל חלל הדיסק שכל מקור מנצל עד תום, ומוחק נתונים אם יש צורך בכך.

+ +

כך שאם נפח הדיסק הקשיח שלך הוא 500 ג"ב, אזי שטח האחסון לדפדפן הינו 250 ג"ב. במקרה של חריגה, מופעל תהליך בשם origin eviction, המוחק את כל שווי הנתונים של המקור  עד שכמות הנתונים המאוחסנת חוזרת אל מתחת לגבול. אין כל אפקט של קיצוץ הבא למחוק חלקים של מקורות  — מחיקת בסיס נתונים של מקור עלולה ליצור בעיות של חוסר עקביות.

+ +

קיים גם גבול הקרוי group limit — הוא מוגדר כ- 20% מהגבול הגלובלי, אך יש לו מינימום של 10 מ"ב ומקסימום של 2 ג"ב. כל מקור הוא חלק מקבוצה (קבוצת מקורות). קיימת קבוצה לכל דומיין eTLD+1. לדוגמה:

+ + + +

בקבוצה זו, mozilla.org, www.mozilla.org, ו-joe.blogs.mozilla.org יכולים במצטבר להשתמש במקסימום  20% מהגבול הגלובלי. ל- firefox.com יש מקסימום בנפרד של 20%.

+ +

שני הגבולות מגיבים בצורה שונה כשמגיעים לגבול:

+ + + +
+

לתשומת לבך: הגבול הקבוצתי אינו יכול להיות יותר מהגבול הגלובלי, , למרות מינימום הגבול הקבוצתי הנזכר לעיל . אם הינך במצב של מעט זיכרון באמת כשנניח שהגבול הגלובלי הוא, 8 מ"ב, אז גם הגבול הקבוצתי יהיה  8 מ"ב.

+
+ +
+

לתשומת לבך: כאשר חורגים מהגבול הקבוצתי, או אם פינוי המקור אינו יכול לשחרר מספיק שטח, הדפדפן יצא עם החריגה QuotaExceededError.

+
+ +
+

לתשומת לבך: בכרום מכסת האחסנה הרכה והקשה השתנתה מאז  M66. מידע נוסף ניתן למצוא כאן.

+
+ +

מדיניותLRU

+ +

כאשר שטח הדיסק מתמלא עד תום, מנהל המכסות מתחיל לנקות נתונים בהתבסס על מדיניות  LRU  — המקור בו נעשה שימוש רחוק ביותר מלאחרונה ימחק קודם, ואחר כך זה הבא אחריו, עד שהדפדפן כבר אינו חורג מהגבול.

+ +

אנו עוקבים אחרי "זמן הגישה האחרון" עבור כל מקור באמצעות אחסנה זמנית. כאשר מושג הגבול הגלובלי עבור אחסנה זמנית (עוד אודות הגבול מאוחר יותר), אנו מנסים למצוא את כל המקורות שלא היו בשימוש (iכלומר אלה ללא לשוניות.ישומים פתוחים הממשיכים לשמור מאגרי מידע פתוחים). אלה ממויינים בשלב זה על פי "זמן הגישה האחרון".  המקור שהיה בשימוש הכי רחוק מלאחרונה נמחקים בשלב זה  עד שיש מספיק מקום להגשים את הבקשה שגרמה לפינוי המקור.

+ +

ראו גם

+ + diff --git a/files/he/web/api/indexeddb_api/index.html b/files/he/web/api/indexeddb_api/index.html new file mode 100644 index 0000000000..957b6f96c5 --- /dev/null +++ b/files/he/web/api/indexeddb_api/index.html @@ -0,0 +1,165 @@ +--- +title: IndexedDB API +slug: Web/API/IndexedDB_API +tags: + - API + - Advanced + - Database + - IndexedDB + - Landing + - NeedsTranslation + - Reference + - Storage + - TopicStub +translation_of: Web/API/IndexedDB_API +--- +
{{DefaultAPISidebar("IndexedDB")}}
+ +

IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution. This is the main landing page for MDN's IndexedDB coverage — here we provide links to the full API reference and usage guides, browser support details, and some explanation of key concepts.

+ +

{{AvailableInWorkers}}

+ +
+

Note: IndexedDB API is powerful, but may seem too complicated for simple cases. If you'd prefer a simple API, try libraries such as localForage, dexie.js, ZangoDB, PouchDB, idb, idb-keyval, JsStore and lovefield that make IndexedDB more programmer-friendly.

+
+ +

Key concepts and usage

+ +

IndexedDB is a transactional database system, like an SQL-based RDBMS. However, unlike SQL-based RDBMSes, which use fixed-column tables, IndexedDB is a JavaScript-based object-oriented database. IndexedDB lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. You need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions.

+ + + +
+

Note: Like most web storage solutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains.

+
+ +

Synchronous and asynchronous

+ +

Operations performed using IndexedDB are done asynchronously, so as not to block applications. IndexedDB originally included both synchronous and asynchronous APIs. The synchronous API was intended for use only with Web Workers but was removed from the spec because it was unclear whether it was needed. However, the synchronous API may be reintroduced if there is enough demand from web developers.

+ +

Storage limits and eviction criteria

+ +

There are a number of web technologies that store data of one kind or another on the client side (i.e. on your local disk). IndexedDB is most commonly talked about. The process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. Browser storage limits and eviction criteria attempts to explain how this works, at least in the case of Firefox.

+ +

Interfaces

+ +

To get access to a database, call open() on the indexedDB attribute of a window object. This method returns an {{domxref("IDBRequest")}} object; asynchronous operations communicate to the calling application by firing events on {{domxref("IDBRequest")}} objects.

+ +

Connecting to a database

+ +
+
{{domxref("IDBEnvironment")}}
+
Provides access to IndexedDB functionality. It is implemented by the {{domxref("window")}} and {{domxref("worker")}} objects. This interface isn't part of the 2.0 specification.
+
{{domxref("IDBFactory")}}
+
Provides access to a database. This is the interface implemented by the global object {{domxref("WindowOrWorkerGlobalScope/indexedDB", "indexedDB")}} and is therefore the entry point for the API.
+
{{domxref("IDBOpenDBRequest")}}
+
Represents a request to open a database.
+
{{domxref("IDBDatabase")}}
+
Represents a connection to a database. It's the only way to get a transaction on the database.
+
+ +

Retrieving and modifying data

+ +
+
{{domxref("IDBTransaction")}}
+
Represents a transaction. You create a transaction on a database, specify the scope (such as which object stores you want to access), and determine the kind of access (read only or readwrite) that you want.
+
{{domxref("IDBRequest")}}
+
Generic interface that handles database requests and provides access to results.
+
{{domxref("IDBObjectStore")}}
+
Represents an object store that allows access to a set of data in an IndexedDB database, looked up via primary key.
+
{{domxref("IDBIndex")}}
+
Also allows access to a subset of data in an IndexedDB database, but uses an index to retrieve the record(s) rather than the primary key. This is sometimes faster than using {{domxref("IDBObjectStore")}}.
+
{{domxref("IDBCursor")}}
+
Iterates over object stores and indexes.
+
{{domxref("IDBCursorWithValue")}}
+
Iterates over object stores and indexes and returns the cursor's current value.
+
{{domxref("IDBKeyRange")}}
+
Defines a key range that can be used to retrieve data from a database in a certain range.
+
{{domxref("IDBLocaleAwareKeyRange")}} {{Non-standard_inline}}
+
Defines a key range that can be used to retrieve data from a database in a certain range, sorted according to the rules of the locale specified for a certain index (see createIndex()'s optionalParameters.). This interface isn't part of the 2.0 specification.
+
+ +

Custom event interfaces

+ +

This specification fires events with the following custom interface:

+ +
+
{{domxref("IDBVersionChangeEvent")}}
+
The IDBVersionChangeEvent interface indicates that the version of the database has changed, as the result of an {{domxref("IDBOpenDBRequest.onupgradeneeded")}} event handler function.
+
+ +

Obsolete interfaces

+ +

An early version of the specification also defined the following, now removed, interfaces. They are still documented in case you need to update previously written code:

+ +
+
{{domxref("IDBVersionChangeRequest")}} {{obsolete_inline}}
+
Represents a request to change the version of a database. The way to change the version of the database has since changed (by calling {{domxref("IDBFactory.open")}} without also calling {{domxref("IDBDatabase.setVersion")}}), and the interface {{domxref("IDBOpenDBRequest")}} now has the functionality of the removed {{domxref("IDBVersionChangeRequest")}}.
+
{{domxref("IDBDatabaseException")}}  {{obsolete_inline}}
+
Represents exception conditions that can be encountered while performing database operations.
+
{{domxref("IDBTransactionSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBTransaction")}}.
+
{{domxref("IDBObjectStoreSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBObjectStore")}}.
+
{{domxref("IDBIndexSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBIndex")}}.
+
{{domxref("IDBFactorySync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBFactory")}}.
+
{{domxref("IDBEnvironmentSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBEnvironment")}}.
+
{{domxref("IDBDatabaseSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBDatabase")}}.
+
{{domxref("IDBCursorSync")}} {{obsolete_inline}}
+
Sync version of {{domxref("IDBCursor")}}.
+
+ +

Examples

+ + + +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("IndexedDB 2")}}{{Spec2("IndexedDB 2")}}
{{SpecName('IndexedDB')}}{{Spec2('IndexedDB')}}Initial definition
+ +

See also

+ + diff --git a/files/he/web/api/storage/clear/index.html b/files/he/web/api/storage/clear/index.html new file mode 100644 index 0000000000..f93b7cf4a4 --- /dev/null +++ b/files/he/web/api/storage/clear/index.html @@ -0,0 +1,52 @@ +--- +title: Storage.clear() +slug: Web/API/Storage/clear +translation_of: Web/API/Storage/clear +--- +

{{APIRef("Web Storage API")}}

+ +

פונקציית ()clear מאפשרת לנקות את כל המפתחות מהאחסון המקומי.

+ +

תחביר

+ +
storage.clear();
+ +

ערך חוזר

+ +

undefined.

+ +

דוגמאות

+ +

הפונקציה הבאה יוצרת שלושה פריטים באחסון המקומי, ולאחר מכן מוחקת אותם.

+ +
function populateStorage() {
+  localStorage.setItem('bgcolor', 'red');
+  localStorage.setItem('font', 'Helvetica');
+  localStorage.setItem('image', 'miGato.png');
+
+  localStorage.clear();
+}
+
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-clear', 'Storage.clear')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Storage.clear")}}

diff --git a/files/he/web/api/storage/getitem/index.html b/files/he/web/api/storage/getitem/index.html new file mode 100644 index 0000000000..d18fcf9d3d --- /dev/null +++ b/files/he/web/api/storage/getitem/index.html @@ -0,0 +1,75 @@ +--- +title: localStorage.getItem() +slug: Web/API/Storage/getItem +translation_of: Web/API/Storage/getItem +--- +

{{APIRef("Web Storage API")}}

+ +

 

+ +

פונקציית ()getItem מאפשרת לאחזר נתונים מהאחסון המקומי באמצעות שם המפתח.
+ במידה והמפתח שרוצים לאחזר אינו קיים באחסון המקומי, יוחזר הערך null.

+ +

תחביר

+ +
var aValue = localStorage.getItem(keyName);
+
+ +

פרמטרים

+ +
+
keyName
+
שם המפתח אותו רוצים לאחזר.
+
+ +

ערך חוזר

+ +

במידה והמפתח קיים באחסון המקומי הוא יחזיר את ערכו. במידה והמפתח אינו קיים יוחזר הערך null.

+ +

דוגמאות

+ +

הפונקציה הבאה מאחזרת שלושה פריטי נתונים מהאחסון המקומי ולאחר מכן משתמשת בהם כדי להגדיר גיליונות סגנון מדורגים.

+ +
function setStyles() {
+  var currentColor = localStorage.getItem('bgcolor');
+  var currentFont = localStorage.getItem('font');
+  var currentImage = localStorage.getItem('image');
+
+  currentColor = document.getElementById('bgcolor').value;
+  currentFont = document.getElementById('font').value;
+  currentImage = document.getElementById('image').value;
+
+  htmlElem.style.backgroundColor = '#' + currentColor;
+  pElem.style.fontFamily = currentFont;
+  imgElem.setAttribute('src', currentImage);
+}
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-getitem', 'Storage.getItem')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Storage.getItem")}}

+ +

ראו גם

+ + diff --git a/files/he/web/api/storage/index.html b/files/he/web/api/storage/index.html new file mode 100644 index 0000000000..b89a1ef6a2 --- /dev/null +++ b/files/he/web/api/storage/index.html @@ -0,0 +1,107 @@ +--- +title: Storage +slug: Web/API/Storage +tags: + - API + - Interface + - NeedsTranslation + - Reference + - Storage + - TopicStub + - Web Storage + - data +translation_of: Web/API/Storage +--- +

{{APIRef("Web Storage API")}}

+ +

The Storage interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.

+ +

To manipulate, for instance, the session storage for a domain, a call to the {{domxref("Window.sessionStorage")}} is made; whereas for local storage the call is made to {{domxref("Window.localStorage")}}.

+ +

Properties

+ +
+
{{domxref("Storage.length")}} {{readonlyInline}}
+
Returns an integer representing the number of data items stored in the Storage object.
+
+ +

Methods

+ +
+
{{domxref("Storage.key()")}}
+
When passed a number n, this method will return the name of the nth key in the storage.
+
+ +
+
{{domxref("Storage.getItem()")}}
+
When passed a key name, will return that key's value.
+
{{domxref("Storage.setItem()")}}
+
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
+
{{domxref("Storage.removeItem()")}}
+
When passed a key name, will remove that key from the storage.
+
{{domxref("Storage.clear()")}}
+
When invoked, will empty all keys out of the storage.
+
+ +

Examples

+ +

Here we access a Storage object by calling localStorage. We first test whether the local storage contains data items using !localStorage.getItem('bgcolor'). If it does, we run a function called setStyles() that grabs the data items using {{domxref("Storage.getItem()")}} and uses those values to update page styles. If it doesn't, we run another function, populateStorage(), which uses {{domxref("Storage.setItem()")}} to set the item values, then runs setStyles().

+ +
if(!localStorage.getItem('bgcolor')) {
+  populateStorage();
+}
+setStyles();
+
+function populateStorage() {
+  localStorage.setItem('bgcolor', document.getElementById('bgcolor').value);
+  localStorage.setItem('font', document.getElementById('font').value);
+  localStorage.setItem('image', document.getElementById('image').value);
+}
+
+function setStyles() {
+  var currentColor = localStorage.getItem('bgcolor');
+  var currentFont = localStorage.getItem('font');
+  var currentImage = localStorage.getItem('image');
+
+  document.getElementById('bgcolor').value = currentColor;
+  document.getElementById('font').value = currentFont;
+  document.getElementById('image').value = currentImage;
+
+  htmlElem.style.backgroundColor = '#' + currentColor;
+  pElem.style.fontFamily = currentFont;
+  imgElem.setAttribute('src', currentImage);
+}
+ +
+

Note: To see this running as a complete working example, see our Web Storage Demo.

+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#the-storage-interface', 'Storage')}}{{Spec2('HTML WHATWG')}} 
+ +

Browser compatibility

+ + + +

{{Compat("api.Storage")}}

+ +

See also

+ + diff --git a/files/he/web/api/storage/key/index.html b/files/he/web/api/storage/key/index.html new file mode 100644 index 0000000000..9dfce0e52b --- /dev/null +++ b/files/he/web/api/storage/key/index.html @@ -0,0 +1,55 @@ +--- +title: Storage.key() +slug: Web/API/Storage/key +translation_of: Web/API/Storage/key +--- +

{{APIRef("Web Storage API")}}

+ +

פונקציית ()key מאפשרת לאחזר את שם המפתח באמצעות אינדקס.

+ +

תחביר

+ +
var aKeyName = storage.key(index);
+ +

פרמטרים

+ +
+
index
+
מספר שלם המייצג את מיקום המפתח שברצוננו לאחזר.
+
+ +

ערך חוזר

+ +

במידה והמפתח קיים באחסון המקומי הוא יחזיר את שמו. במידה והמפתח אינו קיים יוחזר הערך null.

+ +

דוגמאות

+ +

הפונקציה הבאה חוזרת על פריטי האחסון המקומיים ומקבלת את הערך שהוגדר עבור כל מפתח:

+ +
for(var i =0; i < localStorage.length; i++){
+   console.log(localStorage.getItem(localStorage.key(i)));
+}
+
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-key', 'Storage.key')}}{{Spec2('HTML WHATWG')}} 
+ +

Browser compatibility

+ + + +

{{Compat("api.Storage.key")}}

diff --git a/files/he/web/api/storage/length/index.html b/files/he/web/api/storage/length/index.html new file mode 100644 index 0000000000..6939e0bd1f --- /dev/null +++ b/files/he/web/api/storage/length/index.html @@ -0,0 +1,51 @@ +--- +title: Storage.length +slug: Web/API/Storage/length +translation_of: Web/API/Storage/length +--- +

{{APIRef("Web Storage API")}}

+ +

המאפיין length מאפשר לאחזר את מספר כל הפריטים שנמצאים באחסון המקומי ולהציגם באמצעות מספר שלם.

+ +

תחביר

+ +
var aLength = Storage.length;
+ +

ערך חוזר

+ +

מספר שלם.

+ +

דוגמאות

+ +

הפונקציה הבאה מוסיפה שלושה פריטים לאחסון המקומי ולאחר מכן מחזירה את מספר כל הפריטים שנמצאים באחסון המקומי:

+ +
function populateStorage() {
+  localStorage.setItem('bgcolor', 'yellow');
+  localStorage.setItem('font', 'Helvetica');
+  localStorage.setItem('image', 'cats.png');
+
+  localStorage.length; // should return 3
+}
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-length', 'Storage.length')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Storage.length")}}

diff --git a/files/he/web/api/storage/removeitem/index.html b/files/he/web/api/storage/removeitem/index.html new file mode 100644 index 0000000000..5760eae6b3 --- /dev/null +++ b/files/he/web/api/storage/removeitem/index.html @@ -0,0 +1,66 @@ +--- +title: Storage.removeItem() +slug: Web/API/Storage/removeItem +translation_of: Web/API/Storage/removeItem +--- +

{{APIRef("Web Storage API")}}

+ +

פונקציית ()removeItem מאפשרת לאחזר נתונים מהאחסון המקומי באמצעות שם המפתח.
+ ובמידה ושם המפתח לא קיים באחסון המקומי לא יבוצעו שינויים.

+ +

תחביר

+ +
storage.removeItem(keyName);
+ +

פרמטרים

+ +
+
keyName
+
שם המפתח אותו רוצים למחוק.
+
+ +

ערך חוזר

+ +

חלל ריק.

+ +

דוגמאות

+ +

הפונקציה הבאה יוצרת שלושה פריטים בתוך האחסון המקומי ולאחר מכן מסירה את פריט התמונה מהאחסון המקומי.

+ +
function populateStorage() {
+  localStorage.setItem('bgcolor', 'red');
+  localStorage.setItem('font', 'Helvetica');
+  localStorage.setItem('image', 'myCat.png');
+
+  localStorage.removeItem('image');
+}
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-removeitem', 'Storage.removeItem')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Storage.removeItem")}}

+ +

ראו גם

+ + diff --git a/files/he/web/api/storage/setitem/index.html b/files/he/web/api/storage/setitem/index.html new file mode 100644 index 0000000000..84225ee467 --- /dev/null +++ b/files/he/web/api/storage/setitem/index.html @@ -0,0 +1,69 @@ +--- +title: Storage.setItem() +slug: Web/API/Storage/setItem +translation_of: Web/API/Storage/setItem +--- +

{{APIRef("Web Storage API")}}
+ פונקציית ()setItem מאפשרת להוסיף נתונים אל האחסון המקומי באמצעות שני פרמטרים: שם מפתח וערך שאותם תיצור או תעדכן במידה וקיימים.

+ +

תחביר

+ +
storage.setItem(keyName, keyValue);
+ +

פרמטרים

+ +
+
keyName
+
מכיל את שמו של המפתח אותו יש ליצור או לעדכן.
+
keyValue
+
מכיל את שם הערך שיתווסף למפתח אותו אנו יוצרים או מעדכנים.
+
+ +

ערך חוזר

+ +

undefined.

+ +

החרגות

+ +

במידה והאחסון מלא המערכות עשויה לנקות נתונים מהאחסון המקומי.
+ בגרסה הניידת של דפדפן Safari, במידה והמשתמש נכנס אל מצב פרטי המערכת אינה שומרת נתונים באחסון המקומי ומסירה אותם באופן אוטומטי בשל מגבלת גודל של 0 בתים.

+ +

דוגמאות

+ +

הפונקציה הבאה יוצרת שלושה פריטי נתונים בתוך האחסון המקומי.

+ +
function populateStorage() {
+  localStorage.setItem('bgcolor', 'red');
+  localStorage.setItem('font', 'Helvetica');
+  localStorage.setItem('image', 'myCat.png');
+}
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-setitem', 'Storage.setItem')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Storage.setItem")}}

+ +

ראו גם

+ + diff --git a/files/he/web/api/web_storage_api/index.html b/files/he/web/api/web_storage_api/index.html new file mode 100644 index 0000000000..51a64e09b3 --- /dev/null +++ b/files/he/web/api/web_storage_api/index.html @@ -0,0 +1,111 @@ +--- +title: ממשק פיתוח היישומים Web Storage +slug: Web/API/Web_Storage_API +translation_of: Web/API/Web_Storage_API +--- +
{{DefaultAPISidebar("Web Storage API")}}
+ +

The Web Storage API provides mechanisms by which browsers can store key/value pairs, in a much more intuitive fashion than using {{glossary("cookie", "cookies")}}.

+ +

Web Storage concepts and usage

+ +

The two mechanisms within Web Storage are as follows:

+ + + +

These mechanisms are available via the {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} properties (to be more precise, in supporting browsers the Window object implements the WindowLocalStorage and WindowSessionStorage objects, which the localStorage and sessionStorage properties hang off) — invoking one of these will create an instance of the {{domxref("Storage")}} object, through which data items can be set, retrieved and removed. A different Storage object is used for the sessionStorage and localStorage for each origin — they function and are controlled separately.

+ +
+

Note: From Firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10MB. This has been done to avoid memory issues caused by excessive usage of web storage.

+
+ +
+

Note: Access to Web Storage from third-party IFrames is denied if the user has disabled third-party cookies (Firefox implements this behaviour from version 43 onwards.)

+
+ +
+

Note: Web Storage is not the same as mozStorage (Mozilla's XPCOM interfaces to SQLite) or the Session store API (an XPCOM storage utility for use by extensions).

+
+ +

Web Storage interfaces

+ +
+
{{domxref("Storage")}}
+
Allows you to set, retrieve and remove data for a specific domain and storage type (session or local.)
+
{{domxref("Window")}}
+
The Web Storage API extends the {{domxref("Window")}} object with two new properties — {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} — which provide access to the current domain's session and local {{domxref("Storage")}} objects respectively, and a {{domxref("Window.onstorage")}} event handler that fires when a storage area changes (e.g. a new item is stored.)
+
{{domxref("StorageEvent")}}
+
The storage event is fired on a document's Window object when a storage area changes.
+
+ +

Examples

+ +

To illustrate some typical web storage usage, we have created a simple example, imaginatively called Web Storage Demo. The landing page provides controls that can be used to customize the colour, font and decorative image. When you choose different options, the page is instantly updated; in addition your choices are stored in localStorage, so that when you leave the page then load it again later on your choices are remembered.

+ +

In addition, we have provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as the {{domxref("StorageEvent")}} is fired.

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'webstorage.html#webstorage')}}{{Spec2('HTML WHATWG')}}
+ +

Browser compatibility

+ +

Window.localStorage

+ +
+ + +

{{Compat("api.Window.localStorage")}}

+ +

Window.sessionStorage

+ +
+ + +

{{Compat("api.Window.sessionStorage")}}

+
+
+ +

Private Browsing / Incognito modes

+ +

Most modern browsers support a privacy option called 'Incognito', 'Private Browsing' or something similar that doesn't store data like history and cookies. This is fundamentally incompatible with Web Storage for obvious reasons. As such, browser vendors are experimenting with different scenarios for how to deal with this incompatibility.

+ +

Most browsers have opted for a strategy where storage APIs are still available and seemingly fully functional, with the one big difference that all stored data is wiped after the browser is closed. For these browsers there are still different interpretations of what should be done with existing stored data (from a regular browsing session). Should it be available to read when in Private mode? Then there are some browsers, most notably Safari, that have opted for a solution where storage is available, but is empty and has a quota of 0 bytes assigned, effectively making it impossible to write data to it.

+ +

Developers should be aware of these different implementations and take them into account when developing websites depending on Web Storage APIs. For more information please have a look at this WHATWG blog post that specifically deals with this topic.

+ +

See also

+ + diff --git a/files/he/web/api/window/alert/index.html b/files/he/web/api/window/alert/index.html new file mode 100644 index 0000000000..0346b5f73a --- /dev/null +++ b/files/he/web/api/window/alert/index.html @@ -0,0 +1,70 @@ +--- +title: Window.alert() +slug: Web/API/Window/alert +tags: + - אזהרה + - חלון הודעה + - פופ-אפ +translation_of: Web/API/Window/alert +--- +

{{ APIRef }}

+ +

Window.alert() - מציגה הודעת אזהרה עם תוכן וכפתור לאישור וסגירה.

+ +

תחביר

+ +
window.alert(message);
+ +

פרמטרים

+ +
+
message {{optional_inline}}
+
מחרוזת שתופיעה כגוף ההודעה בתיבת הדו-שיח של ההתראה.
+
+ +

דוגמאות

+ +
window.alert("Hello world!");
+alert("Hello world!");
+ +

שתי הדוגמאות מייצרות את ההודעה הבאה:

+ +

Image:AlertHelloWorld.png

+ +

הערות

+ +

 

+ +

תפקידן של תיבות ההתראה הינן להצגת הודעות שאינן דורשות תגובה מצד המשתמש, מלבד היכרות וקריאת ההודעה.

+ +

 

+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#dom-alert', 'alert()')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Window.alert")}}

+ +

ראה גם

+ + diff --git a/files/he/web/api/window/confirm/index.html b/files/he/web/api/window/confirm/index.html new file mode 100644 index 0000000000..54ab3e903a --- /dev/null +++ b/files/he/web/api/window/confirm/index.html @@ -0,0 +1,70 @@ +--- +title: Window.confirm() +slug: Web/API/Window/confirm +tags: + - אישור הודעה + - דפדפן + - הודעה + - חלון התראה + - פופ-אפ +translation_of: Web/API/Window/confirm +--- +
{{ApiRef("Window")}}
+ +
Window.confirm() - מציגה תיבת דו-שיח עם תוכן וכפתורי אישור וביטול.
+ +

תחביר

+ +
result = window.confirm(message);
+
+ + + +

דוגמאות

+ +
if (window.confirm("Do you really want to leave?")) {
+  window.open("exit.html", "Thanks for Visiting!");
+}
+
+ +

הדוגמה תציג את ההודעה הבאה:

+ +

firefox confirm
+  

+ +

הערות

+ +

The following text is shared between this article, DOM:window.prompt and DOM:window.alert תיבות דו-שיח מונעות מהמשתמש גישה לממשק התוכנית עד אשר היא תיסגר.

+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#dom-confirm', 'confirm()')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Window.confirm")}}

+ +

ראה גם

+ + diff --git a/files/he/web/api/window/index.html b/files/he/web/api/window/index.html new file mode 100644 index 0000000000..70b807464b --- /dev/null +++ b/files/he/web/api/window/index.html @@ -0,0 +1,509 @@ +--- +title: Window +slug: Web/API/Window +tags: + - API + - DOM + - Interface + - JavaScript + - NeedsTranslation + - Reference + - Tab + - TopicStub + - Window +translation_of: Web/API/Window +--- +
{{APIRef("DOM")}}
+ +

The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window. A window for a given document can be obtained using the {{domxref("document.defaultView")}} property.

+ +

A global variable, window, representing the window in which the script is running, is exposed to JavaScript code.

+ +

The Window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window. However, the Window interface is a suitable place to include these items that need to be globally available. Many of these are documented in the  JavaScript Reference and the DOM Reference.

+ +

In a tabbed browser, each tab is represented by its own Window object; the global window seen by JavaScript code running within a given tab always represents the tab in which the code is running. That said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as {{Domxref("Window.resizeTo", "resizeTo()")}} and {{Domxref("Window.innerHeight", "innerHeight")}}. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.

+ +

{{InheritanceDiagram}}

+ +

Properties

+ +

This interface inherits properties from the {{domxref("EventTarget")}} interface and implements properties from the {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("WindowEventHandlers")}} mixins.

+ +

Note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are listed in a separate section below.

+ +
+
{{domxref("Window.closed")}} {{Non-standard_inline}} {{readOnlyInline}}
+
This property indicates whether the current window is closed or not.
+
{{domxref("Window.console")}} {{ReadOnlyInline}}
+
Returns a reference to the console object which provides access to the browser's debugging console.
+
{{domxref("Window.content")}} and Window._content {{Non-standard_inline}} {{obsolete_inline}} {{ReadOnlyInline}}
+
Returns a reference to the content element in the current window. Since Firefox 57 (initially Nightly-only), both versions are only available from chrome (privileged) code, and not available to the web anymore.
+
{{domxref("Window.controllers")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns the XUL controller objects for the current chrome window.
+
{{domxref("Window.customElements")}} {{ReadOnlyInline}}
+
returns a reference to the {{domxref("CustomElementRegistry")}} object, which can be used to register new custom elements and get information about previously registered custom elements.
+
{{domxref("Window.crypto")}} {{readOnlyInline}}
+
Returns the browser crypto object.
+
{{domxref("Window.defaultStatus")}} {{Obsolete_inline("gecko23")}}
+
Gets/sets the status bar text for the given window.
+
{{domxref("Window.devicePixelRatio")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns the ratio between physical pixels and device independent pixels in the current display.
+
{{domxref("Window.dialogArguments")}} {{Fx_minversion_inline(3)}} {{ReadOnlyInline}}
+
Gets the arguments passed to the window (if it's a dialog box) at the time {{domxref("window.showModalDialog()")}} was called. This is an {{Interface("nsIArray")}}.
+
{{domxref("Window.directories")}} {{obsolete_inline}}
+
Synonym of {{domxref("window.personalbar")}}
+
{{domxref("Window.document")}} {{ReadOnlyInline}}
+
Returns a reference to the document that the window contains.
+
{{domxref("Window.DOMMatrix")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMMatrix")}} object, which represents 4x4 matrices, suitable for 2D and 3D operations.
+
{{domxref("Window.DOMMatrixReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMMatrixReadOnly")}} object, which represents 4x4 matrices, suitable for 2D and 3D operations.
+
{{domxref("Window.DOMPoint")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMPoint")}} object, which represents a 2D or 3D point in a coordinate system.
+
{{domxref("Window.DOMPointReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMPointReadOnly")}} object, which represents a 2D or 3D point in a coordinate system.
+
{{domxref("Window.DOMQuad")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMQuad")}} object, which provides represents a quadrilaterial object, that is one having four corners and four sides.
+
{{domxref("Window.DOMRect")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMRect")}} object, which represents a rectangle.
+
{{domxref("Window.DOMRectReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMRectReadOnly")}} object, which represents a rectangle.
+
{{domxref("Window.event")}} {{ReadOnlyInline}}
+
Returns the current event, which is the event currently being handled by the JavaScript code's context, or undefined if no event is currently being handled. The {{domxref("Event")}} object passed directly to event handlers should be used instead whenever possible.
+
{{domxref("Window.frameElement")}} {{readOnlyInline}}
+
Returns the element in which the window is embedded, or null if the window is not embedded.
+
{{domxref("Window.frames")}} {{readOnlyInline}}
+
Returns an array of the subframes in the current window.
+
{{domxref("Window.fullScreen")}} {{gecko_minversion_inline("1.9")}}
+
This property indicates whether the window is displayed in full screen or not.
+
{{domxref("Window.globalStorage")}} {{gecko_minversion_inline("1.8.1")}} {{Non-standard_inline}} {{Obsolete_inline("gecko13")}}
+
Unsupported since Gecko 13 (Firefox 13). Use {{domxref("Window.localStorage")}} instead.
+ Was: Multiple storage objects that are used for storing data across multiple pages.
+
{{domxref("Window.history")}} {{ReadOnlyInline}}
+
Returns a reference to the history object.
+
{{domxref("Window.innerHeight")}} {{readOnlyInline}}
+
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
+
{{domxref("Window.innerWidth")}} {{readOnlyInline}}
+
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
+
{{domxref("Window.isSecureContext")}} {{experimental_inline}} {{readOnlyInline}}
+
Indicates whether a context is capable of using features that require secure contexts.
+
{{domxref("Window.length")}} {{readOnlyInline}}
+
Returns the number of frames in the window. See also {{domxref("window.frames")}}.
+
{{domxref("Window.location")}}
+
Gets/sets the location, or current URL, of the window object.
+
{{domxref("Window.locationbar")}} {{ReadOnlyInline}}
+
Returns the locationbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.localStorage")}} {{readOnlyInline}} {{gecko_minversion_inline("1.9.1")}}
+
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
+
{{domxref("Window.menubar")}} {{ReadOnlyInline}}
+
Returns the menubar object, whose visibility can be toggled in the window.
+
{{domxref("Window.messageManager")}} {{gecko_minversion_inline("2.0")}}
+
Returns the message manager object for this window.
+
{{domxref("Window.mozAnimationStartTime")}} {{ReadOnlyInline}} {{gecko_minversion_inline("2.0")}} {{Deprecated_inline}}
+
The time in milliseconds since epoch at which the current animation cycle began. Use {{domxref("Animation.startTime")}} instead.
+
{{domxref("Window.mozInnerScreenX")}} {{ReadOnlyInline}} {{non-standard_inline}} {{gecko_minversion_inline("1.9.2")}}
+
Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in {{interface("nsIDOMWindowUtils")}} for a conversion factor to adapt to screen pixels if needed.
+
{{domxref("Window.mozInnerScreenY")}} {{ReadOnlyInline}} {{non-standard_inline}} {{gecko_minversion_inline("1.9.2")}}
+
Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.
+
{{domxref("Window.mozPaintCount")}} {{non-standard_inline}} {{ReadOnlyInline}} {{gecko_minversion_inline("2.0")}}
+
Returns the number of times the current document has been rendered to the screen in this window. This can be used to compute rendering performance.
+
{{domxref("Window.name")}}
+
Gets/sets the name of the window.
+
{{domxref("Window.navigator")}} {{readOnlyInline}}
+
Returns a reference to the navigator object.
+
{{domxref("Window.opener")}}
+
Returns a reference to the window that opened this current window.
+
{{domxref("Window.orientation")}} {{non-standard_inline}} {{deprecated_inline}} {{readOnlyInline}}
+
Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
+
{{domxref("Window.outerHeight")}} {{readOnlyInline}}
+
Gets the height of the outside of the browser window.
+
{{domxref("Window.outerWidth")}} {{readOnlyInline}}
+
Gets the width of the outside of the browser window.
+
{{domxref("Window.scrollX","Window.pageXOffset")}} {{readOnlyInline}}
+
An alias for {{domxref("window.scrollX")}}.
+
{{domxref("Window.scrollY","Window.pageYOffset")}} {{readOnlyInline}}
+
An alias for {{domxref("window.scrollY")}}
+
{{domxref("Window.parent")}} {{readOnlyInline}}
+
Returns a reference to the parent of the current window or subframe.
+
{{domxref("Window.performance")}} {{readOnlyInline}}
+
Returns a {{domxref("Performance")}} object, which includes the {{domxref("Performance.timing", "timing")}} and {{domxref("Performance.navigation", "navigation")}} attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples.
+
{{domxref("Window.personalbar")}} {{readOnlyInline}}
+
Returns the personalbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.pkcs11")}} {{obsolete_inline(29)}}
+
Formerly provided access to install and remove PKCS11 modules.
+
{{domxref("Window.returnValue")}} {{Fx_minversion_inline(3)}}
+
The return value to be returned to the function that called {{domxref("window.showModalDialog()")}} to display the window as a modal dialog.
+
{{domxref("Window.screen")}} {{readOnlyInline}}
+
Returns a reference to the screen object associated with the window.
+ +
{{domxref("Window.screenX")}} {{readOnlyInline}}
+
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
+
{{domxref("Window.screenY")}} {{readOnlyInline}}
+
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
+
{{domxref("Window.scrollbars")}} {{readOnlyInline}}
+
Returns the scrollbars object, whose visibility can be toggled in the window.
+
{{domxref("Window.scrollMaxX")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
+
{{domxref("Window.scrollMaxY")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
+
{{domxref("Window.scrollX")}} {{readOnlyInline}}
+
Returns the number of pixels that the document has already been scrolled horizontally.
+
{{domxref("Window.scrollY")}} {{readOnlyInline}}
+
Returns the number of pixels that the document has already been scrolled vertically.
+
{{domxref("Window.self")}} {{ReadOnlyInline}}
+
Returns an object reference to the window object itself.
+
{{domxref("Window.sessionStorage")}}
+
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
+
{{domxref("Window.sidebar")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns a reference to the window object of the sidebar.
+
{{domxref("Window.speechSynthesis")}} {{ReadOnlyInline}}
+
Returns a {{domxref("SpeechSynthesis")}} object, which is the entry point into using Web Speech API speech synthesis functionality.
+
{{domxref("Window.status")}}
+
Gets/sets the text in the statusbar at the bottom of the browser.
+
{{domxref("Window.statusbar")}} {{readOnlyInline}}
+
Returns the statusbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.toolbar")}} {{readOnlyInline}}
+
Returns the toolbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.top")}} {{readOnlyInline}}
+
Returns a reference to the topmost window in the window hierarchy. This property is read only.
+
{{domxref("Window.visualViewport")}} {{readOnlyInline}}
+
Returns a {{domxref("VisualViewport")}} object which represents the visual viewport for a given window.
+
{{domxref("Window.window")}} {{ReadOnlyInline}}
+
Returns a reference to the current window.
+
window[0], window[1], etc.
+
Returns a reference to the window object in the frames. See {{domxref("Window.frames")}} for more details.
+
+ +

Properties implemented from elsewhere

+ +
+
{{domxref("WindowOrWorkerGlobalScope.caches")}} {{readOnlyinline}}
+
Returns the {{domxref("CacheStorage")}} object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
+
{{domxref("WindowOrWorkerGlobalScope.indexedDB")}} {{readonlyInline}}
+
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an {{domxref("IDBFactory")}} object.
+
{{domxref("WindowOrWorkerGlobalScope.isSecureContext")}} {{readOnlyinline}}
+
Returns a boolean indicating whether the current context is secure (true) or not (false).
+
{{domxref("WindowOrWorkerGlobalScope.origin")}} {{readOnlyinline}}
+
Returns the global object's origin, serialized as a string. (This does not yet appear to be implemented in any browser.)
+
+ +

Methods

+ +

This interface inherits methods from the {{domxref("EventTarget")}} interface and implements methods from {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("EventTarget")}}.

+ +
+
{{domxref("Window.alert()")}}
+
Displays an alert dialog.
+ +
{{domxref("Window.back()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Moves back one in the window history. This method is obsolete; you should instead use {{domxref("History.back", "window.history.back()")}}.
+
{{domxref("Window.blur()")}}
+
Sets focus away from the window.
+
{{domxref("Window.cancelAnimationFrame()")}} {{experimental_inline}}
+
Enables you to cancel a callback previously scheduled with {{domxref("Window.requestAnimationFrame")}}.
+
{{domxref("Window.cancelIdleCallback()")}} {{experimental_inline}}
+
Enables you to cancel a callback previously scheduled with {{domxref("Window.requestIdleCallback")}}.
+
{{domxref("Window.captureEvents()")}} {{Deprecated_inline}}
+
Registers the window to capture all events of the specified type.
+
{{domxref("Window.clearImmediate()")}}
+
Cancels the repeated execution set using setImmediate.
+
{{domxref("Window.close()")}}
+
Closes the current window.
+
{{domxref("Window.confirm()")}}
+
Displays a dialog with a message that the user needs to respond to.
+
{{domxref("Window.disableExternalCapture()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.dispatchEvent()")}}
+
Used to trigger an event.
+
{{domxref("Window.dump()")}} {{Non-standard_inline}}
+
Writes a message to the console.
+
{{domxref("Window.enableExternalCapture()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.find()")}}
+
Searches for a given string in a window.
+
{{domxref("Window.focus()")}}
+
Sets focus on the current window.
+
{{domxref("Window.forward()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Moves the window one document forward in the history. This method is obsolete; you should instead use {{domxref("History.forward", "window.history.forward()")}}.
+
{{domxref("Window.getAttention()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Flashes the application icon.
+
{{domxref("Window.getAttentionWithCycleCount()")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.getComputedStyle()")}}
+
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
+
{{domxref("Window.getDefaultComputedStyle()")}} {{Non-standard_inline}}
+
Gets default computed style for the specified element, ignoring author stylesheets.
+
{{domxref("Window.getSelection()")}}
+
Returns the selection object representing the selected item(s).
+
{{domxref("Window.home()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Returns the browser to the home page.
+
{{domxref("Window.matchMedia()")}} {{gecko_minversion_inline("6.0")}}
+
Returns a {{domxref("MediaQueryList")}} object representing the specified media query string.
+
{{domxref("Window.maximize()")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.minimize()")}} (top-level XUL windows only)
+
Minimizes the window.
+
{{domxref("Window.moveBy()")}}
+
Moves the current window by a specified amount.
+
{{domxref("Window.moveTo()")}}
+
Moves the window to the specified coordinates.
+
{{domxref("Window.open()")}}
+
Opens a new window.
+
{{domxref("Window.openDialog()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Opens a new dialog window.
+
{{domxref("Window.postMessage()")}} {{Fx_minversion_inline(3)}}
+
Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
+
{{domxref("Window.print()")}}
+
Opens the Print Dialog to print the current document.
+
{{domxref("Window.prompt()")}}
+
Returns the text entered by the user in a prompt dialog.
+
{{domxref("Window.releaseEvents()")}} {{Non-standard_inline}} {{Deprecated_inline}}
+
Releases the window from trapping events of a specific type.
+
{{domxref("Window.requestAnimationFrame()")}} {{gecko_minversion_inline("2.0")}}
+
Tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
+
{{domxref("Window.requestIdleCallback()")}}  {{experimental_inline}}
+
Enables the scheduling of tasks during a browser's idle periods.
+
{{domxref("Window.resizeBy()")}}
+
Resizes the current window by a certain amount.
+
{{domxref("Window.resizeTo()")}}
+
Dynamically resizes window.
+
{{domxref("Window.restore()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.routeEvent()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.scroll()")}}
+
Scrolls the window to a particular place in the document.
+
{{domxref("Window.scrollBy()")}}
+
Scrolls the document in the window by the given amount.
+
{{domxref("Window.scrollByLines()")}} {{Non-standard_inline}}
+
Scrolls the document by the given number of lines.
+
{{domxref("Window.scrollByPages()")}} {{Non-standard_inline}}
+
Scrolls the current document by the specified number of pages.
+
{{domxref("Window.scrollTo()")}}
+
Scrolls to a particular set of coordinates in the document.
+
{{domxref("Window.setCursor()")}} {{Non-standard_inline}} (top-level XUL windows only)
+
Changes the cursor for the current window
+
{{domxref("Window.setImmediate()")}}
+
Executes a function after the browser has finished other heavy tasks
+
{{domxref("Window.setResizable()")}} {{Non-standard_inline}}
+
Toggles a user's ability to resize a window.
+
{{domxref("Window.sizeToContent()")}} {{Non-standard_inline}}
+
Sizes the window according to its content.
+
{{domxref("Window.stop()")}}
+
This method stops window loading.
+
{{domxref("Window.updateCommands()")}} {{Non-standard_inline}}
+
Updates the state of commands of the current chrome window (UI).
+
+ +

Methods implemented from elsewhere

+ +
+
{{domxref("EventTarget.addEventListener()")}}
+
Register an event handler to a specific event type on the window.
+
{{domxref("WindowOrWorkerGlobalScope.atob()")}}
+
Decodes a string of data which has been encoded using base-64 encoding.
+
{{domxref("WindowOrWorkerGlobalScope.btoa()")}}
+
Creates a base-64 encoded ASCII string from a string of binary data.
+
{{domxref("WindowOrWorkerGlobalScope.clearInterval()")}}
+
Cancels the repeated execution set using {{domxref("WindowOrWorkerGlobalScope.setInterval()")}}.
+
{{domxref("WindowOrWorkerGlobalScope.clearTimeout()")}}
+
Cancels the delayed execution set using {{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}.
+
{{domxref("WindowOrWorkerGlobalScope.createImageBitmap()")}}
+
Accepts a variety of different image sources, and returns a {{domxref("Promise")}} which resolves to an {{domxref("ImageBitmap")}}. Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh.
+
{{domxref("WindowOrWorkerGlobalScope.fetch()")}}
+
Starts the process of fetching a resource from the network.
+
{{domxref("EventTarget.removeEventListener")}}
+
Removes an event listener from the window.
+
{{domxref("WindowOrWorkerGlobalScope.setInterval()")}}
+
Schedules a function to execute every time a given number of milliseconds elapses.
+
{{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}
+
Schedules a function to execute in a given amount of time.
+
+ +

Obsolete methods

+ +
+
{{domxref("Window.showModalDialog()")}} {{obsolete_inline}}
+
Displays a modal dialog. This method was removed completely in Chrome 43, and Firefox 55.
+
+ +

Event handlers

+ +

These are properties of the window object that can be set to establish event handlers for the various things that can happen in the window that might be of interest.

+ +

This interface inherits event handlers from the {{domxref("EventTarget")}} interface and implements event handlers from {{domxref("WindowEventHandlers")}}.

+ +
+

Note: Starting in {{Gecko("9.0")}}, you can now use the syntax if ("onabort" in window) to determine whether or not a given event handler property exists. This is because event handler interfaces have been updated to be proper web IDL interfaces. See DOM event handlers for details.

+
+ +
+
{{domxref("Window.onappinstalled")}}
+
Called when the page is installed as a webapp. See {{event('appinstalled')}} event.
+
{{domxref("Window.onbeforeinstallprompt")}}
+
An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
+
{{domxref("Window.ondevicelight")}}
+
An event handler property for any ambient light levels changes
+
{{domxref("Window.ondevicemotion")}} {{gecko_minversion_inline("6.0")}}
+
Called if accelerometer detects a change (For mobile devices)
+
{{domxref("Window.ondeviceorientation")}} {{gecko_minversion_inline("6.0")}}
+
Called when the orientation is changed (For mobile devices)
+
{{domxref("Window.ondeviceorientationabsolute")}} {{non-standard_inline}} Chrome only
+
An event handler property for any device orientation changes.
+
{{domxref("Window.ondeviceproximity")}}
+
An event handler property for device proximity event
+
{{domxref("Window.ongamepadconnected")}}
+
Represents an event handler that will run when a gamepad is connected (when the {{event('gamepadconnected')}} event fires).
+
{{domxref("Window.ongamepaddisconnected")}}
+
Represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).
+
{{domxref("Window.onmozbeforepaint")}} {{gecko_minversion_inline("2.0")}}
+
An event handler property for the MozBeforePaint event, which is sent before repainting the window if the event has been requested by a call to the {{domxref("Window.mozRequestAnimationFrame()")}} method.
+
{{domxref("Window.onpaint")}}
+
An event handler property for paint events on the window.
+
{{domxref("Window.onrejectionhandled")}} {{experimental_inline}}
+
An event handler for handled {{jsxref("Promise")}} rejection events.
+
{{domxref("Window.onuserproximity")}}
+
An event handler property for user proximity events.
+
{{domxref("Window.onvrdisplayconnect")}}
+
Represents an event handler that will run when a compatible VR device has been connected to the computer (when the {{event("vrdisplayconnected")}} event fires).
+
{{domxref("Window.onvrdisplaydisconnect")}}
+
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the {{event("vrdisplaydisconnected")}} event fires).
+
{{domxref("Window.onvrdisplayactivate")}}
+
Represents an event handler that will run when a display is able to be presented to (when the {{event("vrdisplayactivate")}} event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
+
{{domxref("Window.onvrdisplaydeactivate")}}
+
Represents an event handler that will run when a display can no longer be presented to (when the {{event("vrdisplaydeactivate")}} event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
+
{{domxref("Window.onvrdisplayblur")}}
+
Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the {{event("vrdisplayblur")}} event fires) — for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience.
+
{{domxref("Window.onvrdisplayfocus")}}
+
Represents an event handler that will run when presentation to a display has resumed after being blurred (when the {{event("vrdisplayfocus")}} event fires).
+
{{domxref("Window.onvrdisplaypresentchange")}}
+
represents an event handler that will run when the presenting state of a VR device changes — i.e. goes from presenting to not presenting, or vice versa (when the {{event("vrdisplaypresentchange")}} event fires).
+
+ +

Event handlers implemented from elsewhere

+ +
+
{{domxref("GlobalEventHandlers.onabort")}}
+
Called when the loading of a resource has been aborted, such as by a user canceling the load while it is still in progress
+
{{domxref("WindowEventHandlers.onafterprint")}}
+
Called when the print dialog box is closed. See {{event("afterprint")}} event.
+
{{domxref("WindowEventHandlers.onbeforeprint")}}
+
Called when the print dialog box is opened. See {{event("beforeprint")}} event.
+
{{domxref("WindowEventHandlers.onbeforeunload")}}
+
An event handler property for before-unload events on the window.
+
{{domxref("GlobalEventHandlers.onblur")}}
+
Called after the window loses focus, such as due to a popup.
+
{{domxref("GlobalEventHandlers.onchange")}}
+
An event handler property for change events on the window.
+
{{domxref("GlobalEventHandlers.onclick")}}
+
Called after the ANY mouse button is pressed & released
+
{{domxref("GlobalEventHandlers.ondblclick")}}
+
Called when a double click is made with ANY mouse button.
+
{{domxref("GlobalEventHandlers.onclose")}}
+
Called after the window is closed
+
{{domxref("GlobalEventHandlers.oncontextmenu")}}
+
Called when the RIGHT mouse button is pressed
+
{{domxref("GlobalEventHandlers.onerror")}}
+
Called when a resource fails to load OR when an error occurs at runtime. See {{event("error")}} event.
+
{{domxref("GlobalEventHandlers.onfocus")}}
+
Called after the window receives or regains focus. See {{event("focus")}} events.
+
{{domxref("WindowEventHandlers.onhashchange")}} {{gecko_minversion_inline("1.9.2")}}
+
An event handler property for {{event('hashchange')}} events on the window; called when the part of the URL after the hash mark ("#") changes.
+
{{domxref("GlobalEventHandlers.oninput")}}
+
Called when the value of an <input> element changes
+
{{domxref("GlobalEventHandlers.onkeydown")}}
+
Called when you begin pressing ANY key. See {{event("keydown")}} event.
+
{{domxref("GlobalEventHandlers.onkeypress")}}
+
Called when a key (except Shift, Fn, and CapsLock) is in pressed position. See {{event("keypress")}} event.
+
{{domxref("GlobalEventHandlers.onkeyup")}}
+
Called when you finish releasing ANY key. See {{event("keyup")}} event.
+
{{domxref("WindowEventHandlers.onlanguagechange")}}
+
An event handler property for {{event("languagechange")}} events on the window.
+
{{domxref("GlobalEventHandlers.onload")}}
+
Called after all resources and the DOM are fully loaded. WILL NOT get called when the page is loaded from cache, such as with back button.
+
{{domxref("WindowEventHandlers.onmessage")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("message")}} event is raised.
+
{{domxref("GlobalEventHandlers.onmousedown")}}
+
Called when ANY mouse button is pressed.
+
{{domxref("GlobalEventHandlers.onmousemove")}}
+
Called continously when the mouse is moved inside the window.
+
{{domxref("GlobalEventHandlers.onmouseout")}}
+
Called when the pointer leaves the window.
+
{{domxref("GlobalEventHandlers.onmouseover")}}
+
Called when the pointer enters the window
+
{{domxref("GlobalEventHandlers.onmouseup")}}
+
Called when ANY mouse button is released
+
{{domxref("WindowEventHandlers.onoffline")}}
+
Called when network connection is lost. See {{event("offline")}} event.
+
{{domxref("WindowEventHandlers.ononline")}}
+
Called when network connection is established. See {{event("online")}} event.
+
{{domxref("WindowEventHandlers.onpagehide")}}
+
Called when the user navigates away from the page, before the onunload event. See {{event("pagehide")}} event.
+
{{domxref("WindowEventHandlers.onpageshow")}}
+
Called after all resources and the DOM are fully loaded. See {{event("pageshow")}} event.
+
{{domxref("WindowEventHandlers.onpopstate")}} {{gecko_minversion_inline("2.0")}}
+
Called when a back button is pressed.
+
{{domxref("GlobalEventHandlers.onreset")}}
+
Called when a form is reset
+
{{domxref("GlobalEventHandlers.onresize")}}
+
Called continuously as you are resizing the window.
+
{{domxref("GlobalEventHandlers.onscroll")}}
+
Called when the scroll bar is moved via ANY means. If the resource fully fits in the window, then this event cannot be invoked
+
{{domxref("GlobalEventHandlers.onwheel")}}
+
Called when the mouse wheel is rotated around any axis
+
{{domxref("GlobalEventHandlers.onselect")}}
+
Called after text in an input field is selected
+
{{domxref("GlobalEventHandlers.onselectionchange")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("selectionchange")}} event is raised.
+
{{domxref("WindowEventHandlers.onstorage")}}
+
Called when there is a change in session storage or local storage. See {{event("storage")}} event
+
{{domxref("GlobalEventHandlers.onsubmit")}}
+
Called when a form is submitted
+
{{domxref("WindowEventHandlers.onunhandledrejection")}} {{experimental_inline}}
+
An event handler for unhandled {{jsxref("Promise")}} rejection events.
+
{{domxref("WindowEventHandlers.onunload")}}
+
Called when the user navigates away from the page.
+
+ +

Constructors

+ +

See also the DOM Interfaces.

+ +
+
{{domxref("DOMParser")}}
+
DOMParser can parse XML or HTML source stored in a string into a DOM DocumentDOMParser is specified in DOM Parsing and Serialization.
+
{{domxref("Window.GeckoActiveXObject")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Image")}}
+
Used for creating an {{domxref("HTMLImageElement")}}.
+
{{domxref("Option")}}
+
Used for creating an {{domxref("HTMLOptionElement")}}
+
{{domxref("Window.QueryInterface")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.StaticRange")}} {{experimental_inline}} {{readonlyinline}}
+
Returns a {{domxref('StaticRange.StaticRange','StaticRange()')}} constructor which creates a {{domxref('StaticRange')}} object.
+
{{domxref("Worker")}}
+
Used for creating a Web worker
+
{{domxref("Window.XMLSerializer")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.XPCNativeWrapper")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.XPCSafeJSObjectWrapper")}}
+
{{todo("NeedsContents")}}
+
+ +

Interfaces

+ +

See DOM Reference

+ +

Browser compatibility

+ + + +

{{Compat("api.Window")}}

+ +

See also

+ + diff --git a/files/he/web/api/window/localstorage/index.html b/files/he/web/api/window/localstorage/index.html new file mode 100644 index 0000000000..1f423a8ef1 --- /dev/null +++ b/files/he/web/api/window/localstorage/index.html @@ -0,0 +1,82 @@ +--- +title: Window.localStorage +slug: Web/API/Window/localStorage +translation_of: Web/API/Window/localStorage +--- +

{{APIRef("Web Storage API")}}

+ +

התכונה לקריאה בלבד  localStorage  מאפשרת לך לגשת לאובייקט מסוג {{DOMxRef("Storage")}} עבור המקור של   {{DOMxRef("Document")}}; הנתונים המאוחסניםנשמרים בכל מפגשי הדפדפן. localStorage   דומה ל-{{DOMxRef("Window.sessionStorage", "sessionStorage")}}, פרט לכך שבעוד תוקפם של הנתונים הנשמרים ב- localStorage אינו פג, נתונים הנשמרים ב-,sessionStorage נמחקים עם תום המפגש של הדף  —  כלומר, כשהדף נסגר.

+ +

יש לציין כי נתונים הנשמרים  ב-localStorage או ב-sessionStorage  הם מפורטים בפרוטוקול הדף.

+ +

המפתחות והערכים יביו תמיד מחרוזות (לתשומת לבך, בדומה לאובייקטים, מפתחות מטיפוס מספר שלם יומרו אוטומטית למחרוזות).

+ +

תחביר

+ +
myStorage = window.localStorage;
+ +

ערך

+ +

אובייקט מסוג {{DOMxRef("Storage")}} שניתן להשתמש בו לגישה לשטח האיחסון המקומי של המקור הנוכחי.

+ +

חריגות

+ +
+
SecurityError
+
הבקשה מפרה החלטות מדיניות, או שהמקור אינו  a valid scheme/host/port tuple (זה יכול לקרות אם המקור משתמש בסכמת (t file: או data:, למשל). לדוגמא, ייתכן שלמשתמש דפדפן המוגדר כך שישלול הרשאה לשמור נתונים כבלתי משתנים עבור מקור מסויים.
+
+ +

דוגמא

+ +

קטע הקוד הבא ניגש לאובייקט ה-{{DOMxRef("Storage")}} המקומי של המתחם הנוכחי , ומוסיף לו נתון באמצעות {{DOMxRef("Storage.setItem()")}}.

+ +
localStorage.setItem('myCat', 'Tom');
+ +

התחביר לקריאת נתון ה-localStorage הוא כדלקמן:

+ +
var cat = localStorage.getItem('myCat');
+ +

 התחביר למחיקת נתון ה-localStorage הוא כדלקמן:

+ +
localStorage.removeItem('myCat');
+ +

התחביר למחיקת כל הנתונים ב-localStorage  הוא כדלקמן:

+ +
// Clear all items
+localStorage.clear();
+
+ +
+

לתשומת לבך: נא לעיין במאמר  Using the Web Storage API   כדי לצפות בדוגמא השלמה.

+
+ +

מפרטים

+ + + + + + + + + + + + + + +
מפרטמצבהערה
{{SpecName("HTML WHATWG", "webstorage.html#dom-localstorage", "localStorage")}}{{Spec2("HTML WHATWG")}}
+ +

תאימות דפדפנים

+ + + +

{{Compat("api.Window.localStorage")}}

+ +

לעיון נוסף

+ + diff --git a/files/he/web/api/window/prompt/index.html b/files/he/web/api/window/prompt/index.html new file mode 100644 index 0000000000..a57610aa13 --- /dev/null +++ b/files/he/web/api/window/prompt/index.html @@ -0,0 +1,90 @@ +--- +title: Window.prompt() +slug: Web/API/Window/prompt +tags: + - דו-שיח + - הודעה + - פופ-אפ +translation_of: Web/API/Window/prompt +--- +
{{ApiRef("Window")}}
+ +

Window.prompt() - מציגה תיבת דו-שיח עם תוכן, כפתורי אישור וביטול ומאפשרת למשתמש להזין טקסט ומספרים.

+ +

תחביר

+ +
result = window.prompt(message);
+
+ +

פרמטרים

+ +
+
message {{optional_inline}}
+
מחרוזת שתופיע בגוף ההודעה.
+
+ +

דוגמאות

+ +
let sign = prompt("What's your sign?");
+
+if (sign.toLowerCase() == "scorpio") {
+  alert("Wow! I'm a Scorpio too!");
+}
+
+// there are many ways to use the prompt feature
+sign = window.prompt(); // open the blank prompt window
+sign = prompt();       //  open the blank prompt window
+sign = window.prompt('Are you feeling lucky'); // open the window with Text "Are you feeling lucky"
+sign = window.prompt('Are you feeling lucky', 'sure'); // open the window with Text "Are you feeling lucky" and default value "sure"
+ +

 

+ +

כאשר המשתמש לוחץ על לחצן האישור, הטקסט שהוזן בשדה הקלט מוחזר. במידה והמשתמש לוחץ על אישור מבלי להזין טקסט, מחרוזת ריקה מוחזרת. במידה והמשתמש לוחץ על לחצן ביטול, פונקציה זו מחזירה null.

+ +

ההודעה הנ"ל מופיעה כדלקמן (בדפדפן Chrome במערכת הפעלה OS X):

+ +

 

+ +

prompt() dialog in Chrome on OS X

+ +

הערות

+ +

 

+ +

תיבת הדו-שיח מכילה תיבת טקסט בת שורה אחת, לחצני ביטול ואישור ומחזירה את הטקסט שהמשתמש הזין בתיבת הטקסט. תיבות דו-שיח מונעות מהמשתמש גישה לממשק התוכנית עד אשר היא תיסגר.

+ +

יש לשים לב שהערך המחוזר מהשתמש יהיה מחרוזת. במידה והתשובה שלו צריכה להיות מספר, יש להמיר את הערך למספר.

+ +

 

+ +
const aNumber = Number(window.prompt("Type a number", ""));
+ +

מפרט

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#dom-prompt', 'prompt()')}}{{Spec2('HTML WHATWG')}} 
+ +

תאימות דפדפן

+ + + +

{{Compat("api.Window.prompt")}}

+ +

ראה גם

+ + diff --git a/files/he/web/api/xmlhttprequest/index.html b/files/he/web/api/xmlhttprequest/index.html new file mode 100644 index 0000000000..8a5c739854 --- /dev/null +++ b/files/he/web/api/xmlhttprequest/index.html @@ -0,0 +1,172 @@ +--- +title: XMLHttpRequest +slug: Web/API/XMLHttpRequest +tags: + - AJAX + - API + - Communication + - HTTP + - Interface + - NeedsTranslation + - Reference + - TopicStub + - Web + - XHR + - XMLHttpRequest +translation_of: Web/API/XMLHttpRequest +--- +
{{APIRef("XMLHttpRequest")}}
+ +

Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. XMLHttpRequest is used heavily in Ajax programming.

+ +

{{InheritanceDiagram(650, 150)}}

+ +

Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file and ftp).

+ +

If your communication needs to involve receiving event data or message data from a server, consider using server-sent events through the {{domxref("EventSource")}} interface. For full-duplex communication, WebSockets may be a better choice.

+ +

Constructor

+ +
+
{{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}}
+
The constructor initializes an XMLHttpRequest. It must be called before any other method calls.
+
+ +

Properties

+ +

This interface also inherits properties of {{domxref("XMLHttpRequestEventTarget")}} and of {{domxref("EventTarget")}}.

+ +
+
{{domxref("XMLHttpRequest.onreadystatechange")}}
+
An {{domxref("EventHandler")}} that is called whenever the readyState attribute changes.
+
{{domxref("XMLHttpRequest.readyState")}} {{readonlyinline}}
+
Returns an unsigned short, the state of the request.
+
{{domxref("XMLHttpRequest.response")}} {{readonlyinline}}
+
Returns an {{domxref("ArrayBuffer")}}, {{domxref("Blob")}}, {{domxref("Document")}}, JavaScript object, or a {{domxref("DOMString")}}, depending on the value of {{domxref("XMLHttpRequest.responseType")}}. that contains the response entity body.
+
{{domxref("XMLHttpRequest.responseText")}} {{readonlyinline}}
+
Returns a {{domxref("DOMString")}} that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
+
{{domxref("XMLHttpRequest.responseType")}}
+
Is an enumerated value that defines the response type.
+
{{domxref("XMLHttpRequest.responseURL")}} {{readonlyinline}}
+
Returns the serialized URL of the response or the empty string if the URL is null.
+
{{domxref("XMLHttpRequest.responseXML")}} {{readonlyinline}}
+
Returns a {{domxref("Document")}} containing the response to the request, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML or HTML.
+
{{domxref("XMLHttpRequest.status")}} {{readonlyinline}}
+
Returns an unsigned short with the status of the response of the request.
+
{{domxref("XMLHttpRequest.statusText")}} {{readonlyinline}}
+
Returns a {{domxref("DOMString")}} containing the response string returned by the HTTP server. Unlike {{domxref("XMLHTTPRequest.status")}}, this includes the entire text of the response message ("200 OK", for example).
+
+ +
+

Note: According to the HTTP/2 specification (8.1.2.4 Response Pseudo-Header Fields), HTTP/2 does not define a way to carry the version or reason phrase that is included in an HTTP/1.1 status line.

+
+ +
+
{{domxref("XMLHttpRequest.timeout")}}
+
Is an unsigned long representing the number of milliseconds a request can take before automatically being terminated.
+
{{domxref("XMLHttpRequestEventTarget.ontimeout")}}
+
Is an {{domxref("EventHandler")}} that is called whenever the request times out. {{gecko_minversion_inline("12.0")}}
+
{{domxref("XMLHttpRequest.upload")}} {{readonlyinline}}
+
Is an {{domxref("XMLHttpRequestUpload")}}, representing the upload process.
+
{{domxref("XMLHttpRequest.withCredentials")}}
+
Is a {{domxref("Boolean")}} that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers.
+
+ +

Non-standard properties

+ +
+
{{domxref("XMLHttpRequest.channel")}}{{ReadOnlyInline}}
+
Is a {{Interface("nsIChannel")}}. The channel used by the object when performing the request.
+
{{domxref("XMLHttpRequest.mozAnon")}}{{ReadOnlyInline}}
+
Is a boolean. If true, the request will be sent without cookie and authentication headers.
+
{{domxref("XMLHttpRequest.mozSystem")}}{{ReadOnlyInline}}
+
Is a boolean. If true, the same origin policy will not be enforced on the request.
+
{{domxref("XMLHttpRequest.mozBackgroundRequest")}}
+
Is a boolean. It indicates whether or not the object represents a background service request.
+
{{domxref("XMLHttpRequest.mozResponseArrayBuffer")}}{{gecko_minversion_inline("2.0")}} {{obsolete_inline("6")}} {{ReadOnlyInline}}
+
Is an ArrayBuffer. The response to the request, as a JavaScript typed array.
+
{{domxref("XMLHttpRequest.multipart")}}{{obsolete_inline("22")}}
+
This Gecko-only feature, a boolean, was removed in Firefox/Gecko 22. Please use Server-Sent Events, Web Sockets, or responseText from progress events instead.
+
+ +

Event handlers

+ +

onreadystatechange as a property of the XMLHttpRequest instance is supported in all browsers.

+ +

Since then, a number of additional event handlers have been implemented in various browsers (onload, onerror, onprogress, etc.). See Using XMLHttpRequest.

+ +

More recent browsers, including Firefox, also support listening to the XMLHttpRequest events via standard addEventListener() APIs in addition to setting on* properties to a handler function.

+ +

Methods

+ +
+
{{domxref("XMLHttpRequest.abort()")}}
+
Aborts the request if it has already been sent.
+
{{domxref("XMLHttpRequest.getAllResponseHeaders()")}}
+
Returns all the response headers, separated by CRLF, as a string, or null if no response has been received.
+
{{domxref("XMLHttpRequest.getResponseHeader()")}}
+
Returns the string containing the text of the specified header, or null if either the response has not yet been received or the header doesn't exist in the response.
+
{{domxref("XMLHttpRequest.open()")}}
+
Initializes a request. This method is to be used from JavaScript code; to initialize a request from native code, use openRequest() instead.
+
{{domxref("XMLHttpRequest.overrideMimeType()")}}
+
Overrides the MIME type returned by the server.
+
{{domxref("XMLHttpRequest.send()")}}
+
Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent.
+
{{domxref("XMLHttpRequest.setRequestHeader()")}}
+
Sets the value of an HTTP request header. You must call setRequestHeader()after open(), but before send().
+
+ +

Non-standard methods

+ +
+
{{domxref("XMLHttpRequest.init()")}}
+
Initializes the object for use from C++ code.
+
+ +
Warning: This method must not be called from JavaScript.
+ +
+
{{domxref("XMLHttpRequest.openRequest()")}}
+
Initializes a request. This method is to be used from native code; to initialize a request from JavaScript code, use open() instead. See the documentation for open().
+
{{domxref("XMLHttpRequest.sendAsBinary()")}}{{deprecated_inline()}}
+
A variant of the send() method that sends binary data.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('XMLHttpRequest')}}{{Spec2('XMLHttpRequest')}}Live standard, latest version
+ +

Browser compatibility

+ + + +

{{Compat("api.XMLHttpRequest")}}

+ +

See also

+ + diff --git a/files/he/web/css/index.html b/files/he/web/css/index.html new file mode 100644 index 0000000000..55679b0c8b --- /dev/null +++ b/files/he/web/css/index.html @@ -0,0 +1,97 @@ +--- +title: 'CSS: גיליונות סגנון מדורגים' +slug: Web/CSS +translation_of: Web/CSS +--- +
{{CSSRef}}
+ +

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or {{Glossary("XHTML", "", 1)}}). CSS describes how elements should be rendered on screen, on paper, in speech, or on other media.

+ +

CSS is one of the core languages of the open Web and is standardized across Web browsers according to the W3C specification. Developed in levels, CSS1 is now obsolete, CSS2.1 is a recommendation, and CSS3, now split into smaller modules, is progressing on the standardization track.

+ +
+ + +
+
+

Tutorials

+ +

Our CSS Learning Area features multiple modules that teach CSS from the ground up — no previous knowledge required.

+ +
+
Introduction to CSS
+
This module starts with the basics of how CSS works, including selectors and properties, writing CSS rules, applying CSS to HTML, how to specify length, color, and other units in CSS, cascade and inheritance, box model basics, and debugging CSS.
+
Styling text
+
This module discusses text styling fundamentals, including setting fonts, boldness, italics, line and letter spacing, text drop shadows, and other text properties. This module finishes with applying custom fonts to your page, and styling lists and links.
+
Styling boxes
+
This module looks at styling boxes, one of the fundamental steps towards laying out a web page. In this module we recap the box model, then look at controlling box layouts by setting margins, borders, and padding, custom background colors, images and other features, and fancy features such as drop shadows and filters on boxes.
+
CSS layout
+
At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so you can now dive deep into CSS layout, looking at different display settings, traditional layout methods involving float and positioning, and newfangled layout tools like flexbox.
+
+
+ +
+

Reference

+ + + +

Cookbook

+ +

The CSS layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your own sites. In addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.

+ +

Tools for CSS development

+ + + +

Meta bugs

+ +
    +
  • Firefox: {{bug(1323667)}}
  • +
+
+
+
+ +

See also

+ + diff --git a/files/he/web/css/position/index.html b/files/he/web/css/position/index.html new file mode 100644 index 0000000000..0abe4c2b87 --- /dev/null +++ b/files/he/web/css/position/index.html @@ -0,0 +1,274 @@ +--- +title: 'position: מיקומים' +slug: Web/CSS/position +tags: + - Position + - css positions + - מיקום + - מיקומים ב-CSS +translation_of: Web/CSS/position +--- +
{{CSSRef}}
+ +
מיקומים הינם חוקי CSS המאפשרים לסדר אלמנטים שונים ולשלוט באופן התצוגה שלהם באמצעות מאפיינים שונים:
+ +
{{Cssxref("top")}} ,{{Cssxref("right")}}, {{Cssxref("bottom")}} {{Cssxref("left")}}
+ +
 
+ +
{{EmbedInteractiveExample("pages/css/position.html")}}
+ + + +
+
+

סוגי מיקומים

+
+
+

אלמנט ממוקם הוא אלמנט שערכו המחושב הוא ערך יחסי (relative), מוחלט (absolute), קבוע (fixed) או דביק (sticky) וכל דבר שאינו סטטי (static).

+
+
+ +
{{csssyntax}}
+ +
+
static
+
זהו מאפיין ברירת המחדל הממקם את האלמנט בהתאם לכללים הסטנדרטים של הדף, כמו כן למאפיין {{cssxref("z-index")}} אין השפעה על סדר הדף.
+
relative
+
האלמנט ממוקם בהתאם לזרימה הרגילה של המסמך ולאחר מכן מזיז את עצמו באמצעות הערכים top, right, bottomleft. הזזתו אינה משפיע על מיקומם של מרכיבים אחרים ולכן, המרחב שניתן עבור האלמנט בפריסת הדף זהה לזה של המיקום הסטטי.
+
absolute
+
האלמנט מוסר מהזרימה הרגילה של המסמך, לא נוצר מרווח יחודי עבור האלמנט אותו הוא מייצג. האלמנט ממוקם ביחס לאלמנט relative הקרוב ביותר אליו, במידה ואין כזה הוא ימוקם באופן יחסי לאלמנט האב הראשון של המסמך. ניתן להזיז אותו באמצעות הערכים top, right, bottomleft.
+
fixed
+
האלמנט מוסר מהזרימה הרגילה של המסמך, לא נוצר מרווח יחודי עבור האלמנט אותו הוא מייצג. האלמנט ימוקם באופן קבוע ויחסי לאלמנט האב הראשון של המסמך. ניתן להזיז אותו באמצעות הערכים top, right, bottomleft.
+
sticky
+
האלמנט ממוקם בהתאם לזרימה הרגילה של המסמך ולאחר מכן מזיז את עצמו ביחס לאלמנט האב הקרוב ביותר אליו. ניתן להזיז אותו באמצעות הערכים top, right, bottom, left והתזוזה שלו אינה משפיעה על המיקום של שאר האלמנטים. כאשר משתמשים בתכונה זו יש לשים לב שבעת הגלילה האלמנט יסתיר אלמנטים אחרים שנמצאים מתחתיו.
+
+ +

דוגמאות

+ +

מיקום אלמנט באמצעות Relative 

+ +

HTML

+ +
<div class="box" id="one">One</div>
+<div class="box" id="two">Two</div>
+<div class="box" id="three">Three</div>
+<div class="box" id="four">Four</div>
+
+ +

CSS

+ +
.box {
+  display: inline-block;
+  width: 100px;
+  height: 100px;
+  background: red;
+  color: white;
+}
+
+#two {
+  position: relative;
+  top: 20px;
+  left: 20px;
+  background: blue;
+}
+
+ +

{{ EmbedLiveSample('Relative_positioning', '600px', '200px') }}

+ +

מיקום אלמנט באמצעות Absolute

+ +
<h1>Absolute positioning</h1>
+
+<p>I am a basic block level element. My adjacent block level elements sit on new lines below me.</p>
+
+<p class="positioned">By default we span 100% of the width of our parent element, and we are as tall as our child content. Our total width and height is our content + padding + border width/height.</p>
+
+<p>We are separated by our margins. Because of margin collapsing, we are separated by the width of one of our margins, not both.</p>
+
+<p>inline elements <span>like this one</span> and <span>this one</span> sit on the same line as one another, and adjacent text nodes, if there is space on the same line. Overflowing inline elements <span>wrap onto a new line if possible — like this one containing text</span>, or just go on to a new line if not, much like this image will do: <img src="https://mdn.mozillademos.org/files/13360/long.jpg"></p>
+ +
body {
+  width: 500px;
+  margin: 0 auto;
+}
+
+p {
+  background: aqua;
+  border: 3px solid blue;
+  padding: 10px;
+  margin: 10px;
+}
+
+span {
+  background: red;
+  border: 1px solid black;
+}
+
+.positioned {
+  position: absolute;
+  background: yellow;
+  top: 30px;
+  left: 30px;
+}
+ +

{{ EmbedLiveSample('Absolute_positioning', '100%', 420) }}

+ +

 

+ +

מיקום אלמנט באמצעות Fixed

+ +

HTML

+ +
<div class="outer">
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor eget pulvinar lobortis.
+    Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor augue.
+    Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
+    Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra dictum vel sit amet mi.
+    Duis nisl mauris, aliquam sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue porttitor tortor.
+    Sed tempor nisl a lorem consequat, id maximus erat aliquet. Sed sagittis porta libero sed condimentum.
+    Aliquam finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id ultrices ultrices, tempor et tellus.
+  </p>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor eget pulvinar lobortis.
+    Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor augue.
+    Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
+    Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra dictum vel sit amet mi.
+    Duis nisl mauris, aliquam sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue porttitor tortor.
+    Sed tempor nisl a lorem consequat, id maximus erat aliquet. Sed sagittis porta libero sed condimentum.
+    Aliquam finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id ultrices ultrices, tempor et tellus.
+  </p>
+  <div class="box" id="one">One</div>
+</div>
+
+ +

CSS

+ +
.box {
+  width: 100px;
+  height: 100px;
+  background: red;
+  color: white;
+}
+
+#one {
+  position: fixed;
+  top: 80px;
+  left: 10px;
+  background: blue;
+}
+
+.outer {
+  width: 500px;
+  height: 300px;
+  overflow: scroll;
+  padding-left: 150px;
+}
+
+ +

{{ EmbedLiveSample('Fixed_positioning', '800px', '300px') }}

+ +

מיקום אלמנט באמצעות Sticky 

+ +

HTML

+ +
<dl>
+  <div>
+    <dt>A</dt>
+    <dd>Andrew W.K.</dd>
+    <dd>Apparat</dd>
+    <dd>Arcade Fire</dd>
+    <dd>At The Drive-In</dd>
+    <dd>Aziz Ansari</dd>
+  </div>
+  <div>
+    <dt>C</dt>
+    <dd>Chromeo</dd>
+    <dd>Common</dd>
+    <dd>Converge</dd>
+    <dd>Crystal Castles</dd>
+    <dd>Cursive</dd>
+  </div>
+  <div>
+    <dt>E</dt>
+    <dd>Explosions In The Sky</dd>
+  </div>
+  <div>
+    <dt>T</dt>
+    <dd>Ted Leo &amp; The Pharmacists</dd>
+    <dd>T-Pain</dd>
+    <dd>Thrice</dd>
+    <dd>TV On The Radio</dd>
+    <dd>Two Gallants</dd>
+  </div>
+</dl>
+
+ +

CSS

+ +
* {
+  box-sizing: border-box;
+}
+
+dl > div {
+  background: #FFF;
+  padding: 24px 0 0 0;
+}
+
+dt {
+  background: #B8C1C8;
+  border-bottom: 1px solid #989EA4;
+  border-top: 1px solid #717D85;
+  color: #FFF;
+  font: bold 18px/21px Helvetica, Arial, sans-serif;
+  margin: 0;
+  padding: 2px 0 0 12px;
+  position: -webkit-sticky;
+  position: sticky;
+  top: -1px;
+}
+
+dd {
+  font: bold 20px/45px Helvetica, Arial, sans-serif;
+  margin: 0;
+  padding: 0 0 0 12px;
+  white-space: nowrap;
+}
+
+dd + dd {
+  border-top: 1px solid #CCC;
+}
+
+ +

{{ EmbedLiveSample('Sticky_positioning', '500px', '300px') }}

+ +

מפרטים

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS2.1', 'visuren.html#propdef-position', 'position')}}{{Spec2('CSS2.1')}} 
{{SpecName('CSS3 Positioning','#position-property','position')}}{{Spec2('CSS3 Positioning')}}Adds sticky property value.
+ +

תאימות לדפדפן

+ + + +

{{Compat("css.properties.position")}}

diff --git a/files/he/web/guide/html/html5/index.html b/files/he/web/guide/html/html5/index.html new file mode 100644 index 0000000000..80107c9424 --- /dev/null +++ b/files/he/web/guide/html/html5/index.html @@ -0,0 +1,177 @@ +--- +title: HTML5 +slug: Web/Guide/HTML/HTML5 +tags: + - Guide + - HELP + - HTML + - HTML5 + - NeedsTranslation + - Overview + - TopicStub + - Web + - Web Development +translation_of: Web/Guide/HTML/HTML5 +--- +

HTML5 is the latest evolution of the standard that defines HTML. The term represents two different concepts:

+ + + +

Designed to be usable by all Open Web developers, this reference page links to numerous resources about HTML5 technologies, classified into several groups based on their function.

+ + + +
+

Semantics

+ +
+
Sections and outlines in HTML5
+
A look at the new outlining and sectioning elements in HTML5: {{HTMLElement("section")}}, {{HTMLElement("article")}}, {{HTMLElement("nav")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}} and {{HTMLElement("aside")}}.
+
Using HTML5 audio and video
+
The {{HTMLElement("audio")}} and {{HTMLElement("video")}} elements embed and allow the manipulation of new multimedia content.
+
Forms in HTML5
+
A look at improvements to web forms in HTML5: the constraint validation API, several new attributes, new values for the {{HTMLElement("input")}} attribute {{htmlattrxref("type", "input")}} and the new {{HTMLElement("output")}} element.
+
New semantic elements
+
Beside sections, media and forms elements, there are numerous new elements, like {{HTMLElement("mark")}}, {{HTMLElement("figure")}}, {{HTMLElement("figcaption")}}, {{HTMLElement("data")}}, {{HTMLElement("time")}}, {{HTMLElement("output")}}, {{HTMLElement("progress")}}, or {{HTMLElement("meter")}} and {{HTMLElement("main")}}, increasing the amount of valid HTML5 elements.
+
Improvement in {{HTMLElement("iframe")}}
+
Using the {{htmlattrxref("sandbox", "iframe")}}, {{htmlattrxref("seamless", "iframe")}}, and {{htmlattrxref("srcdoc", "iframe")}} attributes, authors can now be precise about the level of security and the wished rendering of an {{HTMLElement("iframe")}} element.
+
MathML
+
Allows directly embedding mathematical formulas.
+
Introduction to HTML5
+
This article introduces how to indicate to the browser that you are using HTML5 in your web design or web application.
+
HTML5-compliant parser
+
The parser, which turns the bytes of an HTML document into a DOM, has been extended and now precisely defines the behavior to use in all cases, even when faced with invalid HTML. This leads to far greater predictability and interoperability between HTML5-compliant browsers.
+
+ +

Connectivity

+ +
+
Web Sockets
+
Allows creating a permanent connection between the page and the server and to exchange non-HTML data through that means.
+
Server-sent events
+
Allows a server to push events to a client, rather than the classical paradigm where the server could send data only in response to a client's request.
+
WebRTC
+
This technology, where RTC stands for Real-Time Communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application.
+
+ +

Offline & storage

+ +
+
Offline resources: the application cache
+
Firefox fully supports the HTML5 offline resource specification. Most others have offline resource support at some level.
+
Online and offline events
+
Firefox 3 supports WHATWG online and offline events, which let applications and extensions detect whether or not there's an active Internet connection, as well as to detect when the connection goes up and down.
+
WHATWG client-side session and persistent storage (aka DOM Storage)
+
Client-side session and persistent storage allows web applications to store structured data on the client side.
+
IndexedDB
+
IndexedDB is a web standard for the storage of significant amounts of structured data in the browser and for high performance searches on this data using indexes.
+
Using files from web applications
+
Support for the new HTML5 File API has been added to Gecko, making it possible for web applications to access local files selected by the user. This includes support for selecting multiple files using the {{HTMLElement("input")}} of type file HTML element's new multiple attribute. There also is FileReader.
+
+ +

Multimedia

+ +
+
Using HTML5 audio and video
+
The {{HTMLElement("audio")}} and {{HTMLElement("video")}} elements embed and allow the manipulation of new multimedia content.
+
WebRTC
+
This technology, where RTC stands for Real-Time Communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application.
+
Using the Camera API
+
Allows using, manipulating, and storing an image from the computer's camera.
+
Track and WebVTT
+
The {{HTMLElement("track")}} element allows subtitles and chapters. WebVTT is a text track format.
+
+ +

3D, graphics & effects

+ +
+
Canvas Tutorial
+
Learn about the new {{HTMLElement("canvas")}} element and how to draw graphs and other objects in Firefox.
+
HTML5 text API for <canvas> elements
+
The HTML5 text API is now supported by {{HTMLElement("canvas")}} elements.
+
WebGL
+
WebGL brings 3D graphics to the Web by introducing an API that closely conforms to OpenGL ES 2.0 that can be used in HTML5 {{HTMLElement("canvas")}} elements.
+
SVG
+
An XML-based format of vectorial images that can directly be embedded in the HTML.
+
+
+ +
+ +
+

Performance & integration

+ +
+
Web Workers
+
Allows delegation of JavaScript evaluation to background threads, allowing these activities to prevent slowing down interactive events.
+
XMLHttpRequest Level 2
+
Allows fetching asynchronously some parts of the page, allowing it to display dynamic content, varying according to the time and user actions. This is the technology behind Ajax.
+
JIT-compiling JavaScript engines
+
The new generation of JavaScript engines is much more powerful, leading to greater performance.
+
History API
+
Allows the manipulation of the browser history. This is especially useful for pages loading interactively new information.
+
The contentEditable attribute: transform your website to a wiki!
+
HTML5 has standardized the contentEditable attribute. Learn more about this feature.
+
Drag and drop
+
The HTML5 drag and drop API allows support for dragging and dropping items within and between web sites. This also provides a simpler API for use by extensions and Mozilla-based applications.
+
Focus management in HTML
+
The new HTML5 activeElement and hasFocus attributes are supported.
+
Web-based protocol handlers
+
You can now register web applications as protocol handlers using the navigator.registerProtocolHandler() method.
+
requestAnimationFrame
+
Allows control of animations rendering to obtain optimal performance.
+
Fullscreen API
+
Controls the usage of the whole screen for a Web page or application, without the browser UI displayed.
+
Pointer Lock API
+
Allows locking the pointer to the content, so games and similar applications don't lose focus when the pointer reaches the window limit.
+
Online and offline events
+
In order to build a good offline-capable web application, you need to know when your application is actually offline. Incidentally, you also need to know when your application has returned to an online status again.
+
+ +

Device access

+ +
+
Using the Camera API
+
Allows using, manipulating, and storing an image from the computer's camera.
+
Touch events
+
Handlers to react to events created by a user pressing touch screens.
+
Using geolocation
+
Let browsers locate the position of the user using geolocation.
+
Detecting device orientation
+
Get the information when the device on which the browser runs changes orientation. This can be used as an input device (e.g., to make games that react to the position of the device) or to adapt the layout of a page to the orientation of the screen (portrait or landscape).
+
Pointer Lock API
+
Allows locking the pointer to the content, so games and similar application don't lose focus when the pointer reaches the window limit.
+
+ +

Styling

+ +

CSS has been extended to be able to style elements in a much more complex way. This is often referred as CSS3, though CSS is not a monolithic specification any more and the different modules are not all at level 3: some are at level 1 and others at level 4, with all the intermediate levels covered.

+ +
+
New background styling features
+
It is now possible to put a shadow to a box, using {{cssxref("box-shadow")}} and multiple backgrounds can be set.
+
More fancy borders
+
Not only it is now possible to use images to style borders, using {{cssxref("border-image")}} and its associated longhand properties, but rounded borders are supported via the {{cssxref("border-radius")}} property.
+
Animating your style
+
Using CSS Transitions to animate between different states or using CSS Animations to animate parts of the page without a triggering event, you can now control mobile elements on your page.
+
Typography improvement
+
Authors have better control to reach better typography. They can control {{cssxref("text-overflow")}} and hyphenation, but also can add a shadow to it or control more precisely its decorations. Custom typefaces can be downloaded and applied thanks to the new {{cssxref("@font-face")}} at-rule.
+
New presentational layouts
+
In order to improve the flexibility of designs, two new layouts have been added: the CSS multi-column layout, and the CSS flexible box layout.
+
+
+
+ +

 

diff --git a/files/he/web/guide/index.html b/files/he/web/guide/index.html new file mode 100644 index 0000000000..e6e9e81592 --- /dev/null +++ b/files/he/web/guide/index.html @@ -0,0 +1,62 @@ +--- +title: מדריך למפתח אינטרנט +slug: Web/Guide +tags: + - Guide + - Landing + - NeedsTranslation + - TopicStub + - Web +translation_of: Web/Guide +--- +

מאמרים אלה מספקים עזרה לגבי שימוש בטכנלוגיות אינטרנט ו- API מסוימים.

+ +
+
+
+
אזור לימוד HTML
+
HTML (שפת תגיות לתמליל-על או HyperText Markup Language) הינה שפת הליבה של כמעט כל תוכן הרשת. מרבית הדברים על המסך בדפדפן שלך מתוארים בבסיסם על-ידי שימוש ב- HTML.
+
אזור לימוד CSS
+
CSS (גליונות סגנון מדורגים, או Cascading Style Sheets stylesheet) הינה שפה המשמשת להגדיר תצוגת מסמך HTML.
+
מדריך אירועים (Events) למפתח
+
אירועים (Events) מתייחסים לשני דברים:
+ תבנית עיצוב המשמשת לטיפול אסינכרוני במקרים שונים המתרחשים במהלך חיי עמוד האינטרנט;
+ והשיום (naming), אפיון והשימוש במספר גדול של מקרים מסוגים שונים.
+
AJAX
+
AJAX הוא מונח המגדיר קבוצת טכנולוגיות המאפשרות לאפליקציות רשת לבצע עדכונים מהירים ומצטברים לממשק המשתמש ללא טעינה מחדש של כל העמוד. דבר זה הופך את האפליקציה למהירה ותגובתית יותר לפעולות המשתמש.
+
גרפיקה ברשת
+
אתרי אינטרנט ואפליקציות מודרניות זקוקים לעתים להציג גרפיקה עם רמות תחכום שונות.
+
מדריך ל- API ברשת
+
רשימה של כל ה- API האינטרנטיים, ומה הם עושים.
+
ג'אווה-סקריפט (JavaScript)
+
JavaScript היא שפת תסריט (סקריפטינג) חזקה, המשמשת ליצירת אפליקציות באינטרנט.
+
לוקליזציה וקידוד תווים
+
Browsers process text as Unicode internally. However, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. The HTML specification recommends the use of the UTF-8 encoding (which can represent all of Unicode), and regardless of the encoding used requires Web content to declare that encoding.
+
פיתוח אינטרנט למובייל
+
This article provides an overview of some of the main techniques needed to design web sites that work well on mobile devices. If you're looking for information on Mozilla's Firefox OS project, see the Firefox OS page. Or you might be interested in details about Firefox for Android.
+
+
+ +
+
+
אפליקציות אינטרנט מתקדמות (PWA)
+
Progressive web apps (PWAs) use modern web APIs along with traditional progressive enhancement strategy to create cross-platform web applications. These apps work everywhere and provide several features that give them the same user experience advantages as native apps. This set of guides tells you all you need to know about PWAs.
+
אופטימיזציות וביצועים
+
When building modern web apps and sites, it's important to make your content work quickly and efficiently. This lets it perform effectively for both powerful desktop systems and weaker handheld devices.
+
ניתוח וסריאליזציה של XML
+
פלטפורמת הרשת מספקת שיטות שונות לניתוח וסריאליזציה (סדרות) של XML, כל אחת מהן עם יתרונותיה וחסרונותיה.
+
פורמט גופן אינטרנט פתוח (WOFF, Web Open Font Format)
+
WOFF (Web Open Font Format) הוא תצורת קובץ גופן (פונט) זמינה לשימוש ברשת בחינם.
+
שימוש באובייקט FormData
+
אובייקט FormData מאפשר להדר אוסף של זוגות מפתח/ערך (key/value), כדי לשלוח בקשת XMLHttpRequest. הוא מיועד בעיקר לשלוחת פרטי טופס, אבל ניתן להשתמש בו באופן נפרד מטפסים, כדי לשלוח מידע. התשדורת נעשית באותה תצורה כמו שמתודת submit() שולחת טופס שהקידוד שלו הוא "multipart/form-data".
+
מילון מלים
+
מגדיר מספר מונחים טכניים הקשורים לרשת ולאינטרנט.
+
+
+
+ +

ראה גם

+ + diff --git a/files/he/web/guide/localizations_and_character_encodings/index.html b/files/he/web/guide/localizations_and_character_encodings/index.html new file mode 100644 index 0000000000..7ab8aa2ba4 --- /dev/null +++ b/files/he/web/guide/localizations_and_character_encodings/index.html @@ -0,0 +1,62 @@ +--- +title: התאמות למיקומים וקידוד תווים +slug: Web/Guide/Localizations_and_character_encodings +tags: + - HTML + - התאמה למיקום + - צורך בעבודת markup + - קידוד תווים +translation_of: Web/Guide/Localizations_and_character_encodings +--- +

דפדפנים מעבדים טקסט כיוניקוד בתוכם. אולם, דרך לייצג תווים במונחים של בייטים (קידוד תווים) משמשת להעברת טקסט על גבי הרשת לדפדפן. מפרט ה-HTML ממליץ על שימוש בקידוד UTF-8  (היכול לייצג את כל היוניקוד) ובלי קשר לקידוד שבשימוש מצריך כי בתוכן שברשת יוצהר באיזה קידוד השתמשו.

+ +

המאפיין {{htmlattrxref("charset", "meta")}}  של אלמנט ה-{{HTMLElement("meta")}} משמש לציין את קידוד התווים של הדף.

+ +

כדי לציין כי הדף משתמש, לדוגמאף בקידוד תווים UTF-8 (על פי ההמלצה), יש פשוט למקם את השורה הבאה בבלוק ה-{{HTMLElement("head")}}:

+ +
<meta charset="utf-8">
+
+ +

פרטים וקרבי הדפדפן

+ +

כשהקידוד מוצהר בתוכן הרשת כמתחייב ממפרט ה-HTML, פיירפוקס ישתמש בקידוד זה כדי להפוך את הבעעטם לייצוג הפנימי. לרוע המזל, שימוש ב-UTF-8 והצהרה כי UTF-8 הוא הקידוד שבשימוש לא היו תמיד הדרך הנפוצה להציע תוכן ברשת. בשנות ה-1990, היה נפוץ להשאיר את הקידוד לא מוצהר ולהשתמש בקידוד האופייני לאזור שלא היה מסוגל לייצג את כל היוניקוד.

+ +

פיירפוקס זקוק לקידוד לעת-מצוא שישמש לתוכן לא-תואם במתכונת הישנה שאינו מצהיר על קידודו. עבור רוב המיקומים, הקידוד לעת-מצוא הוא windows-1252 (הקרוי לעתים קרובות ISO-8859-1), שהוא הקידוד המתקבל כפלט מרוב אפילקציות ה-Windows בשנות ה-1990 וקבוצת על של הקידוד המתקבל כקלט מרוב יישומי היוניקס בשנות ה-1990 כפי שהתפרש באמריקה ובמערב אירופה.  אולם, קיימים מיקומים שבהם פרסום ברשת היה נפוץ כבר בשנות ה-1990 שקידוד windows-1252 לא התאים לשפה המקומית. במיקומים האלה תוכן במתכונת הישנה שאינו מצהיר את קידודו בופן טיפוסי מקודד באמצעות שיטת קידוד ישנה שאינה windows-1252. על מנת לעבוד עם תוכן המופיע במתכונת הישנה, חלק ממיקומי פיירפוקס זקוקים לקידוד לעת-מצוא שאינו windows-1252.

+ +

לרוע המזל, משמעות הדבר היא כי פונקציונליות פיירפוקס החשופה לרשת נבדלת במיקום וקשה לקרוא תוכן שנכתב במתכונת הישנה בכל המיקומים עם קידודים שונים לעת-מצוא. כדי להימנע היתקלות בבעיות במיקומים בהם פרסומים ברשת באו אחרי אימוץ UTF-8, מיקומים שאין בהם קידוד במתכונת הישנה שצצה מהפרקטיקות של שנות ה-1990, צריכים להשאיר את הקידוד לשעת-מצוא להיות windows-1252 כדי להקל על קריאת תוכן בעל מיקומים שונים ממיקומים שבהם הקידוד לעת מצוא הוא windows-1252. תוכן מקודד UTF-8 בשפת המקום, הנכתב כחדש, מצופה להצהיר על קידודו, שבמקרה זה הקידוד לעת-מצוא אינו חלק מעיבוד התוכן.

+ +

בנוסף, קיים מספר קטן של מיקומים בהם בשנות ה-1990 לא היה קידוד ברור מאליו האופייני לאזור, והזיהוי הראשוני מבין הקידודים בתמכונת הישנה הוצג לראשונה לדפדפני הרשת. לדבר  הייתה השפעה בכך שהמחברים ברשת היו תלויים בנוכחותו של זיהוי ראשוני, ולכן לפיירפוקס עדיין יש זיהוי ראשוני במיקומים אלה.

+ +

מציאת שמות קידוד קאנוניים

+ +

הטקסט שלהלן מתייחס לשמות קאנוניים של קידודים. השמות הקאנוניים הם הערכים מימין לשימן השוויון ב-unixcharset.properties.

+ +

ציון הקידוד לעת מצוא

+ +

מאז פיירפוקס 28, עבר זמנו של קטע זה, משום שההעדפה intl.charset.default אינה קיימת עוד. ההתאמה בין המיקומים לקידודים לעת מצוא  כעת בנויה לתוך  Gecko עצמו.

+ +

 הקידודים לעת מצוא מצויינים על ידי ההעדפהintl.charset.default ב- intl.properties. הן אמורות להיות מוגדרות כשמות הקאנוניים של הקידודים על פי המתכונת הישנה  שהכי צפוי שמשתמשי ההתאמות למיקומים   יפגשו בעת גלישה בתכנים במתכונת הישנה ברשת שאינם מצייתים לכללים ואינם מצהירים על קידודם.  יש לשים לב לכך שקידודים לעת מצוא כפי שהם מוגדרים על ידי המשפט הקודם לא בהכרח צריכים להיות מסוגלים לייצג את התווים הדרושים עבור שפת המיקום!

+ +

הקידוד לעת מצוא צריך להישאר מוגדר כ-windows-1252 עבור מיקומים מערב אירופאיים, מיקומים צפון-, מרכז- ודרום אמריקאיים, מיקומים אפריקאיים, מיקומים מקכז אסיאניים ומיקומים אוקיאניים. טיפוסית המיקום צריך להיות מוגדר אחרת מ-windows-1252 עבור  מיקומים מזרח אירופאיים, מיקומים מזרח תיכוניים ומיקומים צזרח אסיאניים.

+ +

על מנת להימנע מבעיות של יוצרי תוכן ברשת היוצרים תוכן מקודד UTF-8 בלי להצהיר כי UTF-8 הוא הקידוד שבשימוש ועל מנת להעלות למקסימום את היכולת של משתמשים לקרוא תוכן בעל מספר מיקומים, אין להגדיר את הקידוד לעת מצוא ל-UTF-8 לכל מיקום מוגדר כחדש. יש לשים לב שפיירפוקס כבר אינו שולח כותרת HTTP בשם Accept-Charset, כך שאין צורך לקחת בחשבון מה יפורסם ב-Accept-Charset כאשר מגדירים קידוד לעת מצוא.

+ +

למיקומים בהם הקידוד לעת מצוא הוא כעת  ISO-8859-1, הקידוד חייב להשתנות ל-windows-1252. ISO-8859-1 is decoded באותה דרך בדיוק כמו windows-1252, אך פיירפוקס עובר לטפל ב- windows-1252 כמו בתווית המועדפת עבור קידוד זה בהתאם ל- Encoding Standard.

+ +

עבור מיקומים שבהם ל- Internet Explorer נתח שוק יותר גדול מזה של  Firefox, הקידוד לעת מצוא צריך באופן טיפוסי להיות מוגדר לאותו ערך כמו ב-Internet Explorer. .ניתן לראות את הקידוד לעת מצוא שיש לדפדפן מסויים על ידי טעינת  test page. (יש לדאוג להשתמש בהתקנת דפדפן שנותרה לה הגדרות ברירת מחדל כשחוקרים זאת!)

+ +

עבור מיקומים שבהם ל- Firefox מתח שוק גדול יותר מזה של Internet Explorer, סביר להניח כי הטוב ביותר הוא לא לשנות את הקידוד לעת מצוא  אפילו אם אינו תואם את ההדרכה שניתנה לעיל . (לדוגמא, קידוד פיירפוקס עבור המיקומים  הפולני, ההונגרי והצ'כי  סביר שיהיה צריך להמשיך להיות   ISO-8859-2 למרות של-IE הגדרת מיקום לעת-מצוא שונה.)

+ +

כאשר בספק יש להשתמש ב-windows-1252 כקידוד לעת-מצוא.

+ +

ציון אופן הזיהוי ההתחלתי

+ +

אופן הזיהוי ההתחלתי מצויין בהעדפה  intl.charset.detector ב- intl.properties. הגדרה זו חייבת לישאר ריקה לכל המיקומים  שאינם הרוסי, האוקראיני והיפני.  . באף מצב אין לציין את הגלאי "universal". הוא אינו אוניברסלי למרות שמו!

+ +

חריגים עבור שפות מיעוט

+ +

אם ההתאמה למיקומים היא עבור שפת מיעוט והמשתמש הטיפוסי יודע לקרוא את שפת הרוב  של האזור והשתמשים קוראים תוכן אינטרנטי בשפת הרוב של האזר לעתים קרובות מואוד, יהא זה הולם לציין את הקידוד לעת מצוא ואת הזיהוי הראשוני להיות זהה לזה של ההתאמה למיקום עבור שפת הרוב של האזור,  לדוגמא, עבור הגדרת מיקום של שפת מיעוט ברוסיה, יהא הולם להעתיק רת הגדרות המיקום הרוסיות.

+ +

הפיכת מספר קידודים לניתנים לבחירה בקלות מתוך תפריט קידודי תווים

+ +

ההעדפה intl.charsetmenu.browser.static ב- intl.properties הופכת מספר קידודי תווים לזמינים בקלות רבה יותר בתפריט קידודי תווים בדפדפן. על הערך להיות רשימה מופרדת ע"י פסיקים של שמות קידודים קאנוניים.  על הרשימה לכלול לפחות את הקידודים לעת מצוא, את windows-1252 ואת UTF-8. למיקומים שבהם יש יותר מקידוד אחד מהדור הישן, על כל הקידודים האלה להיכלל. לדוגמא, הקידוד לעת מצוא עבור יפני הוא  Shift_JIS, אבל יש עוד קידודים מהדור הישן  : ISO-2022-JP ו- EUC-JP. לכן, יהיה הגיוני אם הרשימה תהיה Shift_JIS, EUC-JP, ISO-2022-JP, windows-1252, UTF-8.

diff --git a/files/he/web/guide/performance/index.html b/files/he/web/guide/performance/index.html new file mode 100644 index 0000000000..6c363e0a0c --- /dev/null +++ b/files/he/web/guide/performance/index.html @@ -0,0 +1,23 @@ +--- +title: אופטימיזציה וביצועים +slug: Web/Guide/Performance +tags: + - אופטימיזציה + - אינטרנט + - ביצועים + - נחיתה + - רשת +translation_of: Web/Guide/Performance +--- +

בעת בניית אתרים ואפליקציות אינטרנט מודרניים, חשוב לגרום לתוכן שלך לתפקד היטב. כלומר לגרום לו להיות מהיר ויעיל. דבר זה מאפשר לתפקד באופן אפקטיבי הן למשתמשי מערכת מחשבים נייחים חזקים, והן למכשירים ניידים פחות חזקיפ. קיימים מספר כלים זמינים לבדיקצת ביצועים של אתר או בלוג. הכלים הראויים ביותר לציון רשומים להלן.

+ + + +

המשאבים לעיל כוללים גם את שיטות העבודה המומלצות לשיפור ביצועים. חשוב לתת עדיפות לביצועים, תוך התחשבות בביצועי הרשת במהלך הפיתוח, כדי שמשתמשים יזכו לחווית המשתמש הטובה ביותר.

+ +

{{LandingPageListSubpages}}

diff --git a/files/he/web/html/element/a/index.html b/files/he/web/html/element/a/index.html new file mode 100644 index 0000000000..de79afa3e5 --- /dev/null +++ b/files/he/web/html/element/a/index.html @@ -0,0 +1,90 @@ +--- +title: ': תגית קישור' +slug: Web/HTML/Element/a +translation_of: Web/HTML/Element/a +--- +

{{HTMLRef}}

+ +

תגית <a> מוסיפה קישור טקסט/תמונה במסמך ה-HTML. זוהי תגית מסוג Inline המסמנת את האלמנט עצמו בלבד.

+ +

 

+ +

{{EmbedInteractiveExample("pages/tabbed/a.html", "tabbed-standard")}}

+ +

 

+ + + + + + + + + + + + + + + + + + + + +
קטגוריהתגיות Inline.
תוכן מורשהטקסטים, תמונות ומספרים +

 

+
תגיות הורים מורשותתגית זו מורשית להופיע בגוף המסמך אך אינה חייבת להיות כפופה בצורה ישירה אל תגית {{HTMLElement("body")}}.
ממשק DOM{{domxref("HTMLAnchorElement")}}
+ +

תארים

+ +

תגית זו נכללת ברשימת התארים הגלובליים.

+ +

href - משמש להוספת כתובת קישור.
+ target - קובע היכן יפתח הקישור (עמוד הנוכחי, כרטיסייה חדשה וכו').
+ id - מזהה המשמש לקישור פנימי בין עמודים.

+ +
+
+

דוגמא 1 - קישור סטנדרטי

+ +
<!-- anchor linking to external file -->
+<a href="https://www.mozilla.com/">
+External Link
+</a>
+
+
+
+

דוגמא 2 - קישור למזהה פנימי בעמוד

+ +
<!-- links to element on this page with id="attr-href" -->
+<a href="#attr-href">
+Description of Same-Page Links
+</a>
+
+
+
+
+

דוגמא 3 - תמונה לחיצה

+ +
<a href="https://developer.mozilla.org/en-US/" target="_blank">
+  <img src="https://mdn.mozillademos.org/files/6851/mdn_logo.png"
+       alt="MDN logo" />
+</a>
+
+
+
+

דוגמא 4 - קישור לדוא"ל

+ +
<a href="mailto:nowhere@mozilla.org">Send email to nowhere</a>
+
+
+
+ +

ראה גם

+ + diff --git a/files/he/web/html/element/address/index.html b/files/he/web/html/element/address/index.html new file mode 100644 index 0000000000..d7997e2296 --- /dev/null +++ b/files/he/web/html/element/address/index.html @@ -0,0 +1,77 @@ +--- +title: '
: תגית לסימון כתובת' +slug: Web/HTML/Element/address +tags: + - Address + - HTML + - כתובת +translation_of: Web/HTML/Element/address +--- +
{{HTMLRef}}
+ +

תגית <address> נועדה כדי להציג מידע ליצירת קשר אודות אדם יחיד או ארגון.

+ +

{{EmbedInteractiveExample("pages/tabbed/address.html", "tabbed-standard")}}

+ + + + + + + + + + + + + + + + + + + + +
קטגוריהתגיות לארגון תוכן.
תוכן מורשה +

<hgroup>
+ <h1-h6>
+ <article>
+ <aside>
+ <section>
+ <nav>
+ <header>
+ <footer>

+
תגיות הורים מורשותתגית זו מורשת להופיע בגוף המסמך אך אינה חייבת להיות כפופה בצורה ישירה אל תגית {{HTMLElement("body")}}.
ממשק DOM{{domxref("HTMLElement")}}
+ +

תארים

+ +

תגית זו נכללת ברשימת התארים הגלובליים.

+ +
+
+

דוגמא

+ +
<address>
+  You can contact author at <a href="http://www.somedomain.com/contact">
+  www.somedomain.com</a>.<br>
+  If you see any bugs, please <a href="mailto:webmaster@somedomain.com">
+  contact webmaster</a>.<br>
+  You may also want to visit us:<br>
+  Mozilla Foundation<br>
+  331 E Evelyn Ave<br>
+  Mountain View, CA 94041<br>
+  USA
+</address>
+
+
+
+ +

ראה גם

+ + diff --git a/files/he/web/html/element/applet/index.html b/files/he/web/html/element/applet/index.html new file mode 100644 index 0000000000..5c85cfaa83 --- /dev/null +++ b/files/he/web/html/element/applet/index.html @@ -0,0 +1,37 @@ +--- +title: ': הטמעה של ישומון ג''אווה בעמוד' +slug: Web/HTML/Element/applet +translation_of: Web/HTML/Element/applet +--- +
{{HTMLRef}}
+ +

תגית <applet> מטמיעה יישומון Java במסמך ה-HTML. אלמנט זה הוצא משימוש לטובת {{HTMLElement ("object")}}.

+ +

* זוהי תגית ישנה ואינה חלק משפת HTML גרסה 5, השימוש ביישומוני Java בדפדפני אינטרנט הופסק.

+ +

תארים

+ +
    +
  • {{htmlattrdef("align")}} -  מציינת את שם העמודה מאובייקט מקור הנתונים.
  • +
  • {{htmlattrdef("alt")}} - תכונה זו משמשת למיקום היישומון בדף ביחס לתוכן.
  • +
  • {{htmlattrdef("code")}} - תכונה זו מציינת את כתובת האתר של קובץ היישומון.
  • +
+ +
+
+

דוגמא

+ +
<applet code="game.class" align="left" archive="game.zip" height="250" width="350">
+  <param name="difficulty" value="easy">
+  <b>Sorry, you need Java to play this game.</b>
+</applet>
+
+
+
+ +

ראה גם

+ +
    +
  • {{HTMLElement("object")}}
  • +
  • {{HTMLElement("embed")}}
  • +
diff --git a/files/he/web/html/element/article/index.html b/files/he/web/html/element/article/index.html new file mode 100644 index 0000000000..f58e278fc5 --- /dev/null +++ b/files/he/web/html/element/article/index.html @@ -0,0 +1,102 @@ +--- +title: '
: תגית לסימון אזור תוכן' +slug: Web/HTML/Element/article +translation_of: Web/HTML/Element/article +--- +
{{HTMLRef}}
+ +

תגית <article> הינה עצמאית ומגדירה אזור תוכן במסמך ה-HTML.
+ התוכן שיוזן בין התגיות עשוי להיות כתבה, מאמר, תגובה או הודעה.

+ +

{{EmbedInteractiveExample("pages/tabbed/article.html", "tabbed-standard")}}

+ + + + + + + + + + + + + + + + + + + + +
קטגוריהתגיות לארגון תוכן.
תוכן מורשה +

<a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <output>, <p>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr>.

+
תגיות הורים מורשותתגית זו מורשת להופיע בגוף המסמך אך אינה חייבת להיות כפופה בצורה ישירה אל תגית {{HTMLElement("section")}}.
ממשק DOM{{domxref("HTMLElement")}}
+ +

תארים

+ +

תגית זו נכללת ברשימת התארים הגלובליים.

+ +
+
+

דוגמא

+ +
<article class="film_review">
+  <header>
+    <h2>Jurassic Park</h2>
+  </header>
+  <section class="main_review">
+    <p>Dinos were great!</p>
+  </section>
+  <section class="user_reviews">
+    <article class="user_review">
+      <p>Way too scary for me.</p>
+      <footer>
+        <p>
+          Posted on
+          <time datetime="2015-05-16 19:00">May 16</time>
+          by Lisa.
+        </p>
+      </footer>
+    </article>
+    <article class="user_review">
+      <p>I agree, dinos are my favorite.</p>
+      <footer>
+        <p>
+          Posted on
+          <time datetime="2015-05-17 19:00">May 17</time>
+          by Tom.
+        </p>
+      </footer>
+    </article>
+  </section>
+  <footer>
+    <p>
+      Posted on
+      <time datetime="2015-05-15 19:00">May 15</time>
+      by Staff.
+    </p>
+  </footer>
+</article>
+
+
+
+ +

הערות

+ +
    +
  • כותרת (<h1> - <h6>) משמשת לרוב כילד של האלמנט <article>.
  • +
  • ניתן להשתמש באלמנט <article> כפוסט או תגובה כהתייחסות לפוסט החיצוני.
  • +
  • ניתן להוסיף את פרטי המחבר באמצעות אלמנט <address>.
  • +
  • ניתן להוסיף תאריך ואת שעת הפרסום התוכן באמצעות מאפיין datetime של אלמנט <time>.
  • +
+ +

ראה גם

+ +
    +
  • {{HTMLElement("nav")}} 
  • +
  • {{HTMLElement("address")}} 
  • +
  • {{HTMLElement("aside")}} 
  • +
  • {{HTMLElement("h1")}} 
  • +
  • {{HTMLElement("hgroup")}}
  • +
diff --git a/files/he/web/html/element/aside/index.html b/files/he/web/html/element/aside/index.html new file mode 100644 index 0000000000..ae470009c2 --- /dev/null +++ b/files/he/web/html/element/aside/index.html @@ -0,0 +1,75 @@ +--- +title: '