From 41c76addc97200aa71105773397aa4edd2af6b4c Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:44:35 +0100 Subject: unslug ar: move --- files/ar/web/javascript/guide/functions/index.html | 698 +++++++++++++++++++++ .../index.html" | 698 --------------------- 2 files changed, 698 insertions(+), 698 deletions(-) create mode 100644 files/ar/web/javascript/guide/functions/index.html delete mode 100644 "files/ar/web/javascript/guide/\330\247\331\204\330\257\331\210\330\247\331\204/index.html" (limited to 'files/ar/web/javascript/guide') diff --git a/files/ar/web/javascript/guide/functions/index.html b/files/ar/web/javascript/guide/functions/index.html new file mode 100644 index 0000000000..af934b397d --- /dev/null +++ b/files/ar/web/javascript/guide/functions/index.html @@ -0,0 +1,698 @@ +--- +title: الدوال +slug: Web/JavaScript/Guide/الدوال +tags: + - الدوال + - جافا سكريبت + - دليل +translation_of: Web/JavaScript/Guide/Functions +--- +
{{jsSidebar("JavaScript Guide")}} {{PreviousNext("Web/JavaScript/Guide/Loops_and_iteration", "Web/JavaScript/Guide/Expressions_and_Operators")}}
+ +

الدوال هي واحدة من اللبنات الأساسية في جافاسكريبت. الدالة، هي عبارة عن مجموعة من التعليمات البرمجية التي تؤدي وظيفة معينة. حتى تتمكن من إستخدام الدالة، عليك أولا تعريفها في مكان ما من النطاق الذي تود إستدعائها منه.

+ +
+

يمكنك القاء نظرة في مرجع مفصل عن دوال الجافاسكريبت حتى تتعرف على تفاصيل اكثر.

+ +

انشاء الدوال

+ +

الاعلان عن الدوال - الصيغة الافتراضية - Function declarations

+ +

تعريف الدالة: تتكون الدالة من الكلمة المحجوزة function، متبوعة بـ :

+ + + +

على سبيل المثال، الكود التالي يعرف دالة بسيطة تسمى square :

+ +
function square(number) {
+  return number * number;
+}
+
+ +

الدالة square تمتلك بارامتر واحد، هو number. وتعليمة برمجية واحدة تقوم بإرجاع بارامتر الدالة number مضروباً في نفسه. والتعليمة return تحدد القيمة التي سترجعها الدالة.

+ +
return number * number;
+
+ +

يتم تمرير البارامترات الاولية primitives (كالسلاسل الحرفية، الاعداد...الخ) الى الدالة، بوسيلة تسمى، الاستدعاء بالقيمة، call by value وهي، ان يتم تحليل argument الدالة، والقيمة الناتجة سَتُرسل نسخة منها فقط إلى المتغير المستقبل (بارامتر الدالة)، بعد ذالك تقوم الدالة بتخزين هذه القيمة في الذاكرة، ثم، إذا كانت الدالة قادرة على تعيين القيم للبارامترات الخاصة بها، تبدا بالعمل على هذه النسخة فقط، دون تغيير اي شئ في قيمة المتغير الاصلي.

+ +

في المثال التالي، لدينا المتغير value سنقوم بتمريره إلى الدالة square. ثم ضمن الدالة square سيتم إنشاء نسخة جديدة، وهكذا، حتى وان قمنا بتغيير القيمة داخل الدالة، فلن يؤثر هذا على قيمة المتغير الأصلي الذي تم تعريفه خارج الدالة. لان هذا التغيير لن يكون مرئيا خارج الدالة:

+ +
function square(number) { // parameter = recipient
+  return number * number;
+}
+var value = 10;
+square(value);   // argument = Sender
+document.write(value);  // log: 10
+
+ +

على عكس المثال السابق، اذا قمت بتمرير كائن (مثلا، قيمة غير اولية ك {{jsxref("Array")}} او كائن معرف من قبل المستخدم) كبارامتر، وقامت الدالة بتغيير خصائص الكائن، سيكون هذا التغيير مرئيا خارج الدالة:

+ +
function myFunc(theObject) {
+  theObject.make = "Toyota";
+}
+
+var mycar = {make: "Honda", model: "Accord", year: 1998};
+var x, y;
+
+x = mycar.make; // x gets the value "Honda"
+
+myFunc(mycar);
+y = mycar.make; // y gets the value "Toyota"
+                // (the make property was changed by the function)
+
+ +

الاعلان عن الدوال بصيغة ال Function expressions

+ +

في حين ان الدالة اعلاه تم الاعلان عنها بصيغة  function declaration، يمكن ايضا انشاء الدوال بصيغة ال function expression. كما يمكن ايضا للدوال ان تكون بصيغة ال anonymous (دوال مجهولة الاسم). على سبيل المثال، الدالة square يمكن تعريفها ايضا بصيغة ال function expression على النحو التالى:

+ +
var square = function(number) { return number * number };
+var x = square(4) // x gets the value 16
+ +

يمكن تعيين اسم للدوال بصيغة ال function expression، لجعل الدالة تعيد استدعاء ذاتها (الاستدعاء الداتي)، أو استخدامه في المنقح debugger. او لتعقب اخطاء الدالة من خلال stack traces.

+ +
var factorial = function fac(n) { return n<2 ? 1 : n*fac(n-1) };
+
+console.log(factorial(3));
+
+ +

يمكنك تمرير دالة كبارامتر لدالة اخرى. يظهر المثال التالي الدالة map تستخدم دالة اخرى كبارامتر اول لها :

+ +
function map(f,a) {
+  var result = [], // Create a new Array
+      i;
+  for (i = 0; i != a.length; i++)
+    result[i] = f(a[i]);
+  return result;
+}
+
+ +

طريقة استخدامها مع الصيغة function expression:

+ +
var multiply = function(x) { return x * x * x; };
+map(multiply, [0, 1, 2, 5, 10]);
+
+ +

طريقة استخدامها مع الصيغة anonymous function مباشرة:

+ +
map(function(x) {return x * x * x}, [0, 1, 2, 5, 10]);
+
+ +

returns [0, 1, 8, 125, 1000].

+ +

في الجافاسكريبت يمكن الاعلان عن دالة اعتمادا على شرط. على سبيل المثال، ستقوم التعليمة البرمجية التالية بالاعلان عن الدالة myFunc شرط ان يكون  num يساوي 0:

+ +
var myFunc;
+if (num === 0){
+  myFunc = function(theObject) {
+    theObject.make = "Toyota"
+  }
+}
+ +

بالإضافة إلى انشاء الدوال كما هو موضح اعلاه، يمكنك ايضا استخدام الصيغة {{jsxref("Function")}} constructor لانشاء دوال من خلال السلاسل النصية، تنفذ وقت التشغيل، تماما كما في  {{jsxref("eval", "()eval")}}.

+ +

هناك فرق بين الدوال (functions) والوظائف (methods)، الدوال هي ما نناقشه في هذا الفصل، والوظائف هي تلك المرتبطة بالكائنات (قيمة لخاصية في الكائن)، اقرأ المزيد حول الكائنات والوظائف العمل مع الكائنات [عربي].

+ +

إستدعاء الدوال

+ +

تعريف الدالة يعني ببساطة إعطاء إسم لها وتحديد ماستقوم به عندما يتم إستدعائها. أما إستدعاء الدالة فيقوم فعليا بتنفيذ الإجراءات مع البرامترات المحددة. على سبيل المثال، إذا قمت بتعريف الدالة square، فستقوم بإستدعائها كما يلي :

+ +
square(5);
+
+ +

تقوم التعليمة البرمجية اعلاه باستدعاء الدالة مع البارامتر 5. ثم تقوم بتنفيذ التعليمات البرمجية المرتبطة بها وترجع القيمة 25.

+ +

الدوال يجب ان تنتمي للنطاق الذي استدعيت فيه، ولان الدوال بصيغة function declaration ترفع اعلى النطاق، فمن الممكن أن تعرف في وقت لاحق، كما في المثال التالي:

+ +
console.log(square(5));
+/* ... */
+function square(n) { return n*n }
+
+ +

نطاق الدالة هو اما الدالة التي تم الإعلان عنها، أو البرنامج بأكمله إذا تم الاعلان عنها في المستوى العلوي.

+ +
+

ملاحظة: سيعمل هذا فقط عندما يتم تعريف الدالة باستخدام الصيغة (مثل {}()function funcName). اما التعليمة البرمجية التالية فسوف لن تعمل، وهذا يعني ان الية الرفع (hoisting) بالنسبة للدوال تعمل فقط مع الدوال ذات الصيغة function declaration ولا تعمل مع الدوال ذات الصيغة function expression.

+
+ +
console.log(square); // square is hoisted with an initial value undefined.
+console.log(square(5)); // TypeError: square is not a function
+var square = function(n) {
+  return n * n;
+}
+
+ +

arguments الدالة لا تقتصر على الاعداد او السلاسل الحرفية فقط، يمكنك تمرير الكائنات ايضا. في القسم الخاص بالعمل مع الكائنات العمل مع الكائنات[عربي] توجد دالة باسم ()showProps توضح كيفية تمرير كائن ك argument للدالة.

+ +

يمكن للدالة أن تقوم بإستدعاء ذاتها. على سبيل المثال، هذه الدالة تقوم بحساب المضروب بشكل متكرر :

+ +
function factorial(n){
+  if ((n === 0) || (n === 1))
+    return 1;
+  else
+    return (n * factorial(n - 1));
+}
+
+ +

في كل مرة تقوم الدالة باستدعاء ذاتها، يتم خصم 1 من قيمة البرامتر الممرر، ويتم ضرب القيمة المحصلة في القيمة العائدة من جديد، فرضا، اذا كانت القيمة الممررة 5، الاستدعاء الاول سيكون 5، الاستدعاء الثاني سيكون 4، الاستدعاء الثالث سيكون 3، وهكذا، ويتم ضرب هذه القيم العائدة مع بعضها البعض. بهذا الشكل :  5 * 4 * 3 * 2 * 1 == 120

+ +

امثلة متنوعة:

+ +
var a, b, c, d, e;
+a = factorial(1); // a gets the value 1    // 1 * 1
+b = factorial(2); // b gets the value 2    // 2 * 1
+c = factorial(3); // c gets the value 6    // 3 * 2 * 1
+d = factorial(4); // d gets the value 24   // 4 * 3 * 2 * 1
+e = factorial(5); // e gets the value 120  // 5 * 4 * 3 * 2 * 1
+
+ +

هناك طرق أخرى لاستدعاء الدوال. غالبا ما تكون هناك حالات تحتاج الى دالة تُستدعى بشكل ديناميكي، حيث يمكن التعامل مع مجموعة من ال arguments، وحيث سياق (context) استدعاء الدالة يجب ان ينشا في وظيفة لكائن يحدد وقت التشغيل. وهذا يبين ان الدوال هي نفسها كائنات، وهذه الكائنات بدورها لديها وظائف ( شاهد {{jsxref("Function")}} object). من ضمن هذه الوظائف، الوظيفة {{jsxref("Function.apply", "()apply")}} يمكن استخدامها لتحقيق هذه الاهداف.

+ +

نطاق الدالة

+ +

المتغيرات المعرفة داخل الدالة لايمكن الوصول إليها من أي مكان آخر خارج الدالة، لأن هذه المتغيرات معرفة فقط داخل نطاق الدالة. على كل، يمكن للدالة الوصول إلى كل المتغيرات والدوال المعرفة في النطاق المعرفة فيه الدالة. بعبارة أخرى، الدالة المعرفة في النطاق العام تستطيع الوصول إلى كل المتغيرات المعرفة في النطاق العام. الدالة المعرفة داخل دالة أخرى يمكنها أيضا الوصول إلى كل المتغيرات المعرفة في دالتها الأم وكل المتغيرات الأخرى التي يمكن للدالة الأم الوصول لها.

+ +
// المتغيرات التالية معرفة في النطاق العام
+var num1 = 20,
+    num2 = 3,
+    name = "Chamahk";
+
+// هذه الدالة معرفة في النطاق العام
+function multiply() {
+  return num1 * num2;
+}
+
+multiply(); // Returns 60
+
+// مثال على دالة داخل دالة
+function getScore () {
+  var num1 = 2,
+      num2 = 3;
+
+  function add() {
+    return name + " scored " + (num1 + num2);
+  }
+
+  return add();
+}
+
+getScore(); // Returns "Chamahk scored 5"
+
+ +

النطاق ومكدس الدوال

+ +

الاستدعاء الذاتي

+ +

يمكن للدالة ان تستدعي داتها بثلاثة طرق:

+ +
    +
  1. من خلال اسم الدالة
  2. +
  3. arguments.callee
  4. +
  5. من خلال المتغيرات التي تشير إلى الدالة
  6. +
+ +

على سبيل المثال، انظر الدالة التالية:

+ +
var foo = function bar() {
+   // statements go here
+};
+
+ +

تضمين الاستدعاء الذاتي داخل جسم الدالة bar:

+ +
    +
  1. ()bar
  2. +
  3. ()arguments.callee
  4. +
  5. ()foo
  6. +
+ +

الدوال التي تقوم باستدعاء نفسها تسمى recursive function. الاستدعاء الداتي يشبه آلِية الحلقات في بعض النواحي، كلاهما ينفذان التعليمات البرمجية نفسها عدة مرات، وايضا كلاهما يتطلبان تعبيرا شرطيا (لتجنب التكرار الى ما لا نهاية، او بالاحرى، الاستدعاء الذاتي الى ما لا نهاية في حالتنا هذه). على سبيل المثال، الحلقة التالية:

+ +
var x = 0;
+while (x < 10) { // "x < 10" is the loop condition
+   // do stuff
+   x++;
+}
+
+ +

المثال التالي يبين دالة تقوم بالاستدعاء الذاتي، يمكنها محاكات الحلقة :

+ +
function loop(x) {
+  if (x >= 10) // "x >= 10" is the exit condition (equivalent to "!(x < 10)")
+    return;
+  // do stuff
+  loop(x + 1); // the recursive call
+}
+loop(0);
+
+ +

ومع ذلك، لا يمكن أن تكون بعض الخوارزميات حلقات تكرارية بسيطة. على سبيل المثال، الوصول الى كافة العقد nodes في بنية الشجرة DOM سيكون اسهل واكثر تفصيلا باستخدام الاستدعاء الذاتي:

+ +
function walkTree(node) {
+  if (node == null) //
+    return;
+  // do something with node
+  for (var i = 0; i < node.childNodes.length; i++) {
+    walkTree(node.childNodes[i]);
+  }
+}
+
+ +

على عكس الحلقات التكرارية البسيطة، والتي تقوم بالتكرار السطحي على DOM، تمكننا دوال الاستدعاء الداتي من تنفيذ عدة استدعاءات، كل استدعاء داتي ينتج عنه العديد من الاستدعاءات الفرعية، بمعنى ان هذا النوع من الدوال يمكنها الوصول الى عمق ال DOM. لتتيح لك امكانية التعامل مع كل جزئية فيه. كما يوضح المثال التالي:

+ +
var walkTree = function recycle( node, fn ) {
+	fn( node );
+	node = node .firstChild;
+	while( node ){
+		recycle( node, fn );
+		node = node.nextSibling;
+	}
+}
+
+walkTree( document.body , function( node ){
+	if( node.nodeType == 1 ){
+		// do something with [object HTMLElements]
+	}
+	if( node.nodeType == 3 ){
+		// do something with [object Text]
+	}
+});
+
+ +

كلا الدالتين اعلاه، تؤدي نفس الغرض، لا اختلاف بينهما، الفرق الوحيد هو شكل بناء الدالة، حيث بنيت الدالة الاولى على طريقة ال  function declaration  فيما بنيت الدالة الثانية على شكل، ال  function expression  وال  anonymous function، وكلاهما تنتهج اسلوب recursive function.

+ +

من الناحية النظرية، من الممكن تحويل أي خوارزمية الاستدعاء الذاتي الى خوارزمية الاستدعاء العادي (مع الحلقات، على سبيل المثال). عموما، المنطق الناتج أكثر تعقيداً ويتطلب استخدام  المكدس. الاستدعاء الذاتي أيضا يستخدم المكدس، مكدس الدالة function stack.

+ +

سلوك مكدس الذاكرة المؤقتة يمكن أن ينظر إليه كما في المثال التالي:

+ +
function foo(i) {
+  if (i < 0)
+    return;
+  console.log('begin:' + i);
+  foo(i - 1);
+  console.log('end:' + i);
+}
+foo(3);
+
+// Output:
+
+// begin:3
+// begin:2
+// begin:1
+// begin:0
+// end:0
+// end:1
+// end:2
+// end:3
+ +

الدوال المتداخلة  و الاغلاق (closures)

+ +

يمكن انشاء دالة داخل دالة اخرى. الدالة الداخلية هي دالة خاصة private بالدالة الخارجة. الدالة الداخلية تشكل الاغلاق closure، والإغلاق هو فقط تعبير (عموما الاغلاق هو دالة). والذي يمكنه الوصول إلى المتغيرات المجانية free variables (المصطلح free variable يشير الى المتغيرات المستخدمة في الدالة، وهي ليست متغيرات محلية او بارامترات لهذه الدالة. بمعنى اخر هي متغيرات معرفة خارج الدالة وتستفيد منها الدالة، وهذا هو سبب تسميتها بالمتغيرات المجانية)،  كما يمكنه ايضا، الوصول الى اي شئ في البيئة التي ترتبط بها هذه المتغيرات المجانية.

+ +

بما ان الدالة الداخلية هي closure. فهذا يعني انها تستطيع ان ترث البرامترات والمتغيرات من الدالة الخارجية. بمعنى اخر، الدالة الداخلية تمتلك النطاق الخاص بالدالة الخارجية.

+ +

الخلاصة:

+ + + +

يظهر المثال التالي الدوال المتداخلة:

+ +
function addSquares(a,b) {
+  function square(x) {
+    return x * x;
+  }
+  return square(a) + square(b);
+}
+a = addSquares(2,3); // returns 13
+b = addSquares(3,4); // returns 25
+c = addSquares(4,5); // returns 41
+
+ +

بما ان الدالة الداخلية تشكل closure. فمن الضروري استدعاء الدالة الخارجية أولا، بعد ذالك يمكنك تحديد ال  arguments لكل منهما :

+ +
function outside(x) {
+  function inside(y) {
+    return x + y;
+  }
+  return inside;
+}
+fn_inside = outside(3); // Think of it like: give me a function that adds 3 to whatever you give it
+result = fn_inside(5); // returns 8
+
+result1 = outside(3)(5); // returns 8
+
+ +

الحفاظ على المتغيرات

+ +

في المثال اعلاه، لاحظ كيف تم الحفاظ على x عندما تم ارجاع الدالة inside. الاغلاق يحفاظ على البرامترات والمتغيرات في جميع النطاقات التي تشير إليه. مع كل استدعاء للدالة الخارجية، يمكنك تعيين arguments مختلفة، سيتم إنشاء إغلاق جديد مع كل استدعاء للدالة outside. يمكن تحرير الذاكرة فقط عندما يكون عائد الدلة inside غير متاحا.

+ +

وهذا لا يختلف عن تخزين المراجع في كائنات أخرى، ولكن غالبا ما يكون أقل وضوحاً نظراً لعدم تعيين المراجع مباشرة ولا يمكن فحصها.

+ +

الدوال الاكثر تداخلا

+ +

الدوال يمكن ان تكون اكثر تداخلا، بمعنى، الدالة (A) تحتضن الدالة (B)، والدالة (B) تحتضن الدالة (C). هنا كل من الدالة B و C تشكل closures، وهكذا B يمكنها الوصول الى  A، و  C يمكنها الوصول الى B. بالاضافة الى ذالك، C يمكنها الوصول الى B و A، وبالتالي، الإغلاق يمكن أن يحتوي على عدة نطاقات. وهذا ما يسمى بسلسلة النطاق scope chaining. (سيتم شرح لماذا يطلق عليه "تسلسل" في وقت لاحق).

+ +

انظر في المثال التالي:

+ +
function A(x) {
+  function B(y) {
+    function C(z) {
+      console.log(x + y + z);
+    }
+    C(3);
+  }
+  B(2);
+}
+A(1); // logs 6 (1 + 2 + 3)
+
+ +

في هذا المثال C تصل الى y الخاصة ب B وايضا الى x الخاصة ب A، أصبح هذا ممكناً لأن:

+ +
    +
  1. B تشكل closure، وتمتلك A، بمعنى B يمكنها الوصول الى البارامترات والمتغيرات الخاصة ب A.
  2. +
  3. C تشكل closure، وتمتلك B.
  4. +
  5. بسبب ان B تمتلك A، فقد اصبح C يمتلك A، وعليه ف C يمكنه الوصول الى البارامترات والمتغيرات الخاصة ب B و A. بعبارات أخرى، C سلسلة نطاقات ل B و A في هذا الترتيب.
  6. +
+ +

العكس ليس صحيحاً. A لا يمكنها الوصول الى C، لان A لا يمكنها الوصول لاي من البارامترات او المتغيرات الخاصة ب B. (فيما C هي متغير لها). وهكذا، C ستصبح خاصة private فقط ب B.

+ +

تضارب الاسماء

+ +

عند وجود اثنين من البارامترات أو المتغيرات التي تحمل نفس الاسم في نطاقات الاغلاق، فهذا يسمى تضارب في الاسماء، وفي هذه الحالة، ستكون الاسبقية للنطاقات الاكثر عمقا في استخدام هذا الاسم، اما بالنسبة للنطاقات الأكثر سطحية سوف تحظى بأولوية أدنى لاستخدام هذا الاسم، من وجهة نظر سلسلة النطاق، النطاق الاول في السلسلة هو النطاق الاكثر عمقا ( اسفل السلسلة)، والنطاق الاخير في السلسلة هو النطاق الاكثر سطحية (اعلى السلسلة). شاهد المثال التالي:

+ +
function outside() {
+  var x = 10;
+  function inside(x) {
+    return x;
+  }
+  return inside;
+}
+result = outside()(20); // returns 20 instead of 10
+
+ +

يحدث تعارض الاسم  في التعليمة return x، وهو مابين الباراميتر x الخاص ب inside وبين المتغير x الخاص ب outside. سلسلة النطاق سترى الامر على هذا النحو {inside, outside, global object}. وبناءا عليه x الخاص ب inside سياخد الاسبقية على x الخاص ب outside، وبالتالي الناتج هو 20 (inside x) بدلا من 10 (outside x).

+ +

الاغلاقات - Closures

+ +

الإغلاق هي واحدة من أقوى المميزات في جافا سكريبت. جافا سكريبت تسمح بتداخل الوظائف وتمنح الدوال الداخلية حق الوصول الكامل إلى كافة المتغيرات والدوال المعرفة داخل الدالة الخارجية (وجميع المتغيرات والدوال الأخرى التي يمكن للدالة الخارجية الوصول إليها). ومع ذالك، الدوال الخارجية لا يمكنها الوصول الى المتغيرات والدوال المعرفة داخل الدوال الداخلية. وهذا يوفر نوعا من الحماية للمتغيرات والدوال الداخلية. وأيضا، لأن الدوال الداخلية لديها حق الوصول إلى نطاق الدالة الخارجية، فالمتغيرات والدوال المعرفة داخل الدالة الخارجية ستدوم اطول من مدة تنفيذ الدالة الخارجىة، اذا تمكنت الدالة الداخلية ان تدوم أطول من الدالة الخارجية. يتم إنشاء الاغلاق عندما تكون الدالة الداخلية بطريقة أو بأخرى في متناول أي نطاق خارج الدالة الخارجية.

+ +
var pet = function(name) {   // The outer function defines a paramrter called "name"
+  var getName = function() {
+    return name;             // The inner function has access to the "name" paramrter of the outer function
+  }
+  return getName;            // Return the inner function, thereby exposing it to outer scopes
+},
+myPet = pet("Vivie");
+
+myPet();                     // Returns "Vivie"
+
+ +

من الناحية العملية، يمكن أن تكون المسالة أكثر تعقيداً من التعليمات البرمجية أعلاه. يمكن إرجاع كائن والذي سيحتوي على وظائف للتعامل مع المتغيرات الداخلية للدالة الخارجية:

+ +
var createPet = function(name) {
+  var sex;
+
+  return {
+    setName: function(newName) {
+      name = newName;
+    },
+
+    getName: function() {
+      return name;
+    },
+
+    getSex: function() {
+      return sex;
+    },
+
+    setSex: function(newSex) {
+      if(typeof newSex === "string" && (newSex.toLowerCase() === "male" || newSex.toLowerCase() === "female")) {
+        sex = newSex;
+      }
+    }
+  }
+}
+
+var pet = createPet("Vivie");
+pet.getName();                  // Vivie
+
+pet.setName("Oliver");
+pet.setSex("male");
+pet.getSex();                   // male
+pet.getName();                  // Oliver
+
+ +

في التعليمات البرمجية اعلاه، المتغير name الخاص بالدالة الخارجية يمكن الوصول اليه من الدوال الداخلية. من المعلوم ايضا، انه، ليس هناك طريقة أخرى للوصول إلى المتغيرات الداخلية إلا من خلال الدوال الداخلية. المتغيرات الداخلية الخاصة بالدوال االداخلية هي بمثابة مخازن آمنة بالنسبة للبارامترات و المتغيرات الخارجية. كما انها تتيح امكانية الوصول الى البيانات الداخلية بشكل دقيق وامن. بالنسبة للدوال، ليس من الضروري تعيينها إلى متغير أو حتى تسميتها.

+ +
var getCode = (function(){
+  var secureCode = "0]Eal(eh&2";    // A code we do not want outsiders to be able to modify...
+
+  return function () {
+    return secureCode;
+  };
+})();
+
+getCode();    // Returns the secureCode
+
+ +

ومع ذلك، يجب الاحتراس جيدا من الوقوع في بعض الفخاخ عند استخدام عمليات الإغلاق. إذا كانت دالة مغلقة تعرف متغير بنفس الاسم، كاسم متغير في النطاق الخارجي، فلا توجد طريقة للإشارة إلى المتغير في النطاق الخارجي مرة أخرى.

+ +
var createPet = function(name) {  // Outer function defines a variable called "name"
+  return {
+    setName: function(name) {    // Enclosed function also defines a variable called "name"
+      name = name;               // ??? How do we access the "name" defined by the outer function ???
+    }
+  }
+}
+
+ +

الكلمة المحجوزة this (في بعض الاحيان تسمى بالمتغير العجيب)، ينبغي التعامل معها بحذر في حالات الإغلاق. احذر، ف this تشير إلى السياق حيث سيتم استدعاء الدالة وليس إلى المكان حيث تم تعريف الدالة.

+ +

استخدام الكائن arguments

+ +

يمكنك التعامل مع  arguments الدالة من الداخل، من خلال الكائن (arguments او الحجج). يمكنك معالجة ال  arguments الممررة الى الدالة على النحو التالي:

+ +
arguments[i]
+
+ +

حيث ان i هو الفهرس الرقمي لل arguments، ويبتدئ من 0، وبالتالي، ال argument الاول الممرر الى الدالة سيكون arguments[0]. لمعرفة عدد ال arguments الممررة نستخدم arguments.length.

+ +

باستخدام الكائن arguments، يمكنك استدعاء دالة مع arguments أكثر من التي تم التصريح بها رسميا. وهي مفيذة جدا، خصوصا إذا كنت لا تعرف مسبقاً كم عدد ال  arguments التي ستمرر اثناء استدعاء الدالة. يمكنك استخدام arguments.length لمعرفة عدد البرامترات الممرة الى الدالة، حتى تتمكن بعد ذالك من التعامل معها من خلال الكائن arguments.

+ +

على سبيل المثال، يمكننا انشاء دالة تقوم بوصل عدة سلاسل حرفية. ال argument الوحيد المحدد رسميا في الدالة، هو السلسلة الحرفية التي ستفصل بين باقي السلاسل الحرفية التي ستمرر ك arguments بعد ال argument الرسمي للدالة.  كما في المثال التالي:

+ +
function myConcat(separator) {
+   var result = "", // initialize list
+       i;
+   // iterate through arguments
+   for (i = 1; i < arguments.length; i++) {
+      result += arguments[i] + separator;
+   }
+   return result;
+}
+
+ +

يمكنك تمرير اي عدد من ال arguments لهذه الدالة، وسترتبط ببعضها البعض من خلال ما سيمرر الى ال argument الرسمي:

+ +
// returns "red, orange, blue, "
+myConcat(", ", "red", "orange", "blue");
+
+// returns "elephant; giraffe; lion; cheetah; "
+myConcat("; ", "elephant", "giraffe", "lion", "cheetah");
+
+// returns "sage. basil. oregano. pepper. parsley. "
+myConcat(". ", "sage", "basil", "oregano", "pepper", "parsley");
+
+ +
+

ملاحظة: المتغير arguments هو شبه مصفوفة، ولكنه ليس مصفوفة. وانما يتصرف كالمصفوفة، يستخدم الفهرسة الرقمية، يستخدم الخاصية length، ومع ذالك، لا يمكنه استخدام الوظائف الخاصة بالمصفوفات مثل push او join ...الخ.

+
+ +

الفرق بين parameters و arguments

+ +

Function parameters او بارامترات الدالة، هي الأسماء المدرجة في تعريف الدالة. فيما Function arguments هي القيم الحقيقية التي تمرر إلى الدالة عند الاستدعاء (راجع التعريف والاستدعاء اعلى الصفحة). انظر المثال التالي:

+ +
function foo( param1, param2, ...) // parameters {
+    // Do things
+}
+foo(arg1, arg2, ...); // arguments
+
+ +
+

ملاحظة: ال parameter هو متغير باسم معين يمرر الى الدالة. تستخدم الباراميترات لجلب ال arguments داخل الدوال.

+
+ +

راجع الكائن {{jsxref("Function")}} في مرجع الجافا سكريبت لمزيد من المعلومات.

+ +

بارامترات الدالة

+ +

بدأً من ECMAScript 6، أصبح هناك نوعان من البارامترات: البارامترات الإفتراضية وبقية البارامترات.

+ +

البارامترات الإفتراضية

+ +

في الجافاسكريبت، القيمة الافتراضية لبرامترات الدوال هي undefined. ومع ذالك، في بعض الحالات، قد يكون من المفيد تعيين قيمة افتراضية مختلفة. البارامترات الافتراضية يمكنها تدارك الموقف.

+ +

قبل ECMAScript 2015، كانت الاستراتيجية العامة لوضع الافتراضات هي اختبار قيمة البارامتر في جسم الدالة وتعيين قيمة له اذا كانت قيمته undefined. على سبيل المثال، في التعليمة البرمجية التالية، لم يتم تحديد قيمة للبارامتر b في الاستدعاء، وبالتالي قيمتة ستساوي undefined، عند اختبار (a * b) ستعود الدالة multiply ب NaN. لتجنب هذا،  يقوم السطر الثاني في التعليمة البرمجية اسفله بتعيين قيمة افتراضية للبارامتر b:

+ +
function multiply(a, b) {
+  b = typeof b !== 'undefined' ?  b : 1;
+
+  return a*b;
+}
+
+multiply(5); // 5
+
+ +

ابتداءا من ECMAScript 2015، اصبح من الممكن عمل اعدادات افتراضية على غرار (php)، والاختبار في جسم الدالة لم يعد ضروريا. الان، ببساطة يمكنك تعيين 1 كقيمة افتراضية للبارامتر b في تعريف الدالة:

+ +
function multiply(a, b = 1) {
+  return a*b;
+}
+
+multiply(5); // 5
+ +

لمزيد من التفاصيل، راجع  default parameters في مرجع الجافاسكريبت.

+ +

بقية البارامترات - rest parameter

+ +

الصيغة rest parameter تسمح بتمثيل عدد غير محدود من ال arguments كمصفوفة. في هذا المثال، نستخدم بقية البارامترات لتجميع ال arguments ابتداءا من البرامتر الثاني لغاية النهاية. ثم نقوم بضربها باول بارامتر. هذا المثال يستخدم دالة السهم، والتي سندرسها في القسم التالي.

+ +
function multiply(multiplier, ...theArgs) {
+  return theArgs.map(x => multiplier * x);
+}
+
+var arr = multiply(2, 1, 2, 3);
+console.log(arr); // [2, 4, 6]
+ +

دوال السهم - Arrow functions

+ +

تعبيرات دوال السهم تسمح لك باستخدام تعبيرا أكثر إيجازاً من التعبير عن الوظائف الكلاسيكية. والقيمة this يتم ربطها بشكل نحوي. فيما تكون دوال السهم مجهولة الاسم anonymous. راجع ايضا هذه المدونة  ES6 In Depth: Arrow functions.

+ +

اثنين من العوامل التي أثرت في مقدمة دوال السهم: الدوال المختصرة و lexical this.

+ +

الدوال المختصرة

+ +

في بعض الأنماط الوظيفية، الدوال المختصرة هي موضع ترحيب. قارن التعليمات البرمجية التالية:

+ +
var a = [
+  "Hydrogen",
+  "Helium",
+  "Lithium",
+  "Beryl­lium"
+];
+
+var a2 = a.map(function(s){ return s.length });
+
+var a3 = a.map( s => s.length );
+ +

التعليمة Lexical this

+ +

قبل وجود وظائف السهم، كانت كل دالة جديدة تعرف قيمة ال this الخاصة بها (كائن جديد في حالة الدالة الإنشائية، undefined في استدعاءات الدوال مع الوضع الصارم، في سياق الكائن قيد التشغيل في حالة الوظيفة، إلخ.). وهذا يمكن أن يسبب بعض المشاكل مع نمط البرمجة الكائنية:

+ +
function Person() {
+  // The Person() constructor defines 'this' as itself.
+  this.age = 0;
+
+  setInterval(function growUp() {
+    // In nonstrict mode, the growUp() function defines 'this'
+    // as the global object, which is different from the 'this'
+    // defined by the Person() constructor.
+  this.age++;
+  }, 1000);
+}
+var p = new Person();
+ +

في ECMAScript 3/5، تم إصلاح هذه المشكلة عن طريق تخزير القيمة this في متغير اخر.

+ +
function Person() {
+  var self = this; // Some choose `that` instead of `self`.
+                   // Choose one and be consistent.
+  self.age = 0;
+
+  setInterval(function growUp() {
+    // The callback refers to the `self` variable of which
+    // the value is the expected object.
+    self.age++;
+  }, 1000);
+}
+ +

بدلا من ذلك، يمكننا إنشاء دالة ملزمة bound function بحيث تكون "احسن"  قيمة this سيتم تمريرها إلى الدالة ()growUp.

+ +

دوال السهم تلتقط القيمة this من السياق المغلق (enclosing context)، لذا ستعمل التعليمة البرمجية التالية كما هو متوقع.

+ +
function Person(){
+  this.age = 0;
+
+  setInterval(() => {
+    this.age++; // |this| properly refers to the person object
+  }, 1000);
+}
+
+var p = new Person();
+ +

دوال معرفة مسبقا

+ +

جافا سكريبت لديها العديد من الوظائف المدمجة ذات المستوى الاعلى top-level :

+ +
+
{{jsxref("Global_Objects/eval", "()eval")}}
+
+

الوظيفة ()eval تستخدم لاختبار شفرة الجافا سكريبت على شكل سلسلة حرفية.

+
+
{{jsxref("Global_Objects/uneval", "()uneval")}} {{non-standard_inline}}
+
+

الوظيفة ()uneval تستخدم لانشاء سلسلة حرفية عبارة عن مصدر كود الكائن {{jsxref("Object")}}.

+
+
{{jsxref("Global_Objects/isFinite", "()isFinite")}}
+
+

الدالة العامة () isFinite تقوم بتحديد ما إذا كانت القيمة التي تم تمريرها عدد محدود. إذا لزم الأمر، يتم تحويل البارامتر إلى رقم.

+
+
{{jsxref("Global_Objects/isNaN", "()isNaN")}}
+
+

تستخدم الدالة()isNaN للتاكد من ان القيمة ليست رقمية {{jsxref("Global_Objects/NaN", "NaN")}}  ملاحظة: يمكننا ايضا استخدام {{jsxref("Number.isNaN()")}}, الجديدة في ECMAScript 6 او استخدام التعليمة typeof. كلها تادي نفس الغرض.

+
+
{{jsxref("Global_Objects/parseFloat", "()parseFloat")}}
+
+

تستخدم الدالة ()parseFloat لتحويل سلسلة حرفية الى عدد كسري.

+
+
{{jsxref("Global_Objects/parseInt", "()parseInt")}}
+
+

تستخدم الدالة ()parseInt لتحويل سلسلة حرفية الى عدد صحيح (البارامتر الثاني خاص بالتعامل مع القاعدة في الأنظمة العددية الرياضية).

+
+
{{jsxref("Global_Objects/decodeURI", "()decodeURI")}}
+
+

تستخدم الدالة ()decodeURI لفك تشفير معرف الموارد الموحد (Uniform Resource Identifier (URI التي تم إنشاؤها مسبقا من طرف {{jsxref("Global_Objects/encodeURI", "encodeURI")}} او عن طريق نفس الروتين.

+
+
{{jsxref("Global_Objects/decodeURIComponent", "()decodeURIComponent")}}
+
+

تستخدم الوظيفة ()decodeURIComponent لفك تشفير معرف عناصر الموارد الموحدة (Uniform Resource Identifier (URI التي تم إنشاؤها مسبقا من طرف {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}} او عن طريق نفس الروتين.

+
+
{{jsxref("Global_Objects/encodeURI", "()encodeURI")}}
+
+

تستخدم الوظيفة ()encodeURI لتشفير معرف الموارد الموحد (Uniform Resource Identifier (URI باستبدال كل مثيل من أحرف معينة بواحد، اثنان، ثلاثة، أو أربعة تهريبات متوالية تمثل ترميز الاحرف UTF-8 (لن يكون إلا أربع تهريبات متوالية لرموز تتألف من اثنين من الحروف "البديلة").

+
+
{{jsxref("Global_Objects/encodeURIComponent", "()encodeURIComponent")}}
+
+

تستخدم الوظيفة ()encodeURIComponent لتشفير معرف عناصر الموارد الموحدة (Uniform Resource Identifier (URI باستبدال كل مثيل من أحرف معينة بواحد، اثنان، ثلاثة، أو أربعة تهريبات متوالية تمثل ترميز الاحرف UTF-8 (لن يكون إلا أربع تهريبات متوالية لاحرف تتألف من اثنين من الحروف "البديلة").

+
+
{{jsxref("Global_Objects/escape", "()escape")}} {{deprecated_inline}}
+
+

الوظيفة ()escape الغير مرغوب فيها. تحتسب سلسلة جديدة من بعض الأحرف التي يجب استبدلها من قبل hexadecimal escape sequence. استخدم {{jsxref("Global_Objects/encodeURI", "encodeURI")}} او استخدم {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}} بدلا عنها.

+
+
{{jsxref("Global_Objects/unescape", "()unescape")}} {{deprecated_inline}}
+
+

الوظيفة()unescape الغير مرغوب فيها. تحتسب سلسلة جديدة بحيث hexadecimal escape sequence. اسبدلت مع الرمز الذي يمثلها. متتالية التهريب يمكن ان تاتى من دالة مثل {{jsxref("Global_Objects/escape", "escape")}}. على العموم استخدم {{jsxref("Global_Objects/decodeURI", "decodeURI()")}} او استخدم {{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent")}} بدلا عنها.

+
+
+ +

 

+
+ +

{{PreviousNext("Web/JavaScript/Guide/Loops_and_iteration", "Web/JavaScript/Guide/Expressions_and_Operators")}}

diff --git "a/files/ar/web/javascript/guide/\330\247\331\204\330\257\331\210\330\247\331\204/index.html" "b/files/ar/web/javascript/guide/\330\247\331\204\330\257\331\210\330\247\331\204/index.html" deleted file mode 100644 index af934b397d..0000000000 --- "a/files/ar/web/javascript/guide/\330\247\331\204\330\257\331\210\330\247\331\204/index.html" +++ /dev/null @@ -1,698 +0,0 @@ ---- -title: الدوال -slug: Web/JavaScript/Guide/الدوال -tags: - - الدوال - - جافا سكريبت - - دليل -translation_of: Web/JavaScript/Guide/Functions ---- -
{{jsSidebar("JavaScript Guide")}} {{PreviousNext("Web/JavaScript/Guide/Loops_and_iteration", "Web/JavaScript/Guide/Expressions_and_Operators")}}
- -

الدوال هي واحدة من اللبنات الأساسية في جافاسكريبت. الدالة، هي عبارة عن مجموعة من التعليمات البرمجية التي تؤدي وظيفة معينة. حتى تتمكن من إستخدام الدالة، عليك أولا تعريفها في مكان ما من النطاق الذي تود إستدعائها منه.

- -
-

يمكنك القاء نظرة في مرجع مفصل عن دوال الجافاسكريبت حتى تتعرف على تفاصيل اكثر.

- -

انشاء الدوال

- -

الاعلان عن الدوال - الصيغة الافتراضية - Function declarations

- -

تعريف الدالة: تتكون الدالة من الكلمة المحجوزة function، متبوعة بـ :

- - - -

على سبيل المثال، الكود التالي يعرف دالة بسيطة تسمى square :

- -
function square(number) {
-  return number * number;
-}
-
- -

الدالة square تمتلك بارامتر واحد، هو number. وتعليمة برمجية واحدة تقوم بإرجاع بارامتر الدالة number مضروباً في نفسه. والتعليمة return تحدد القيمة التي سترجعها الدالة.

- -
return number * number;
-
- -

يتم تمرير البارامترات الاولية primitives (كالسلاسل الحرفية، الاعداد...الخ) الى الدالة، بوسيلة تسمى، الاستدعاء بالقيمة، call by value وهي، ان يتم تحليل argument الدالة، والقيمة الناتجة سَتُرسل نسخة منها فقط إلى المتغير المستقبل (بارامتر الدالة)، بعد ذالك تقوم الدالة بتخزين هذه القيمة في الذاكرة، ثم، إذا كانت الدالة قادرة على تعيين القيم للبارامترات الخاصة بها، تبدا بالعمل على هذه النسخة فقط، دون تغيير اي شئ في قيمة المتغير الاصلي.

- -

في المثال التالي، لدينا المتغير value سنقوم بتمريره إلى الدالة square. ثم ضمن الدالة square سيتم إنشاء نسخة جديدة، وهكذا، حتى وان قمنا بتغيير القيمة داخل الدالة، فلن يؤثر هذا على قيمة المتغير الأصلي الذي تم تعريفه خارج الدالة. لان هذا التغيير لن يكون مرئيا خارج الدالة:

- -
function square(number) { // parameter = recipient
-  return number * number;
-}
-var value = 10;
-square(value);   // argument = Sender
-document.write(value);  // log: 10
-
- -

على عكس المثال السابق، اذا قمت بتمرير كائن (مثلا، قيمة غير اولية ك {{jsxref("Array")}} او كائن معرف من قبل المستخدم) كبارامتر، وقامت الدالة بتغيير خصائص الكائن، سيكون هذا التغيير مرئيا خارج الدالة:

- -
function myFunc(theObject) {
-  theObject.make = "Toyota";
-}
-
-var mycar = {make: "Honda", model: "Accord", year: 1998};
-var x, y;
-
-x = mycar.make; // x gets the value "Honda"
-
-myFunc(mycar);
-y = mycar.make; // y gets the value "Toyota"
-                // (the make property was changed by the function)
-
- -

الاعلان عن الدوال بصيغة ال Function expressions

- -

في حين ان الدالة اعلاه تم الاعلان عنها بصيغة  function declaration، يمكن ايضا انشاء الدوال بصيغة ال function expression. كما يمكن ايضا للدوال ان تكون بصيغة ال anonymous (دوال مجهولة الاسم). على سبيل المثال، الدالة square يمكن تعريفها ايضا بصيغة ال function expression على النحو التالى:

- -
var square = function(number) { return number * number };
-var x = square(4) // x gets the value 16
- -

يمكن تعيين اسم للدوال بصيغة ال function expression، لجعل الدالة تعيد استدعاء ذاتها (الاستدعاء الداتي)، أو استخدامه في المنقح debugger. او لتعقب اخطاء الدالة من خلال stack traces.

- -
var factorial = function fac(n) { return n<2 ? 1 : n*fac(n-1) };
-
-console.log(factorial(3));
-
- -

يمكنك تمرير دالة كبارامتر لدالة اخرى. يظهر المثال التالي الدالة map تستخدم دالة اخرى كبارامتر اول لها :

- -
function map(f,a) {
-  var result = [], // Create a new Array
-      i;
-  for (i = 0; i != a.length; i++)
-    result[i] = f(a[i]);
-  return result;
-}
-
- -

طريقة استخدامها مع الصيغة function expression:

- -
var multiply = function(x) { return x * x * x; };
-map(multiply, [0, 1, 2, 5, 10]);
-
- -

طريقة استخدامها مع الصيغة anonymous function مباشرة:

- -
map(function(x) {return x * x * x}, [0, 1, 2, 5, 10]);
-
- -

returns [0, 1, 8, 125, 1000].

- -

في الجافاسكريبت يمكن الاعلان عن دالة اعتمادا على شرط. على سبيل المثال، ستقوم التعليمة البرمجية التالية بالاعلان عن الدالة myFunc شرط ان يكون  num يساوي 0:

- -
var myFunc;
-if (num === 0){
-  myFunc = function(theObject) {
-    theObject.make = "Toyota"
-  }
-}
- -

بالإضافة إلى انشاء الدوال كما هو موضح اعلاه، يمكنك ايضا استخدام الصيغة {{jsxref("Function")}} constructor لانشاء دوال من خلال السلاسل النصية، تنفذ وقت التشغيل، تماما كما في  {{jsxref("eval", "()eval")}}.

- -

هناك فرق بين الدوال (functions) والوظائف (methods)، الدوال هي ما نناقشه في هذا الفصل، والوظائف هي تلك المرتبطة بالكائنات (قيمة لخاصية في الكائن)، اقرأ المزيد حول الكائنات والوظائف العمل مع الكائنات [عربي].

- -

إستدعاء الدوال

- -

تعريف الدالة يعني ببساطة إعطاء إسم لها وتحديد ماستقوم به عندما يتم إستدعائها. أما إستدعاء الدالة فيقوم فعليا بتنفيذ الإجراءات مع البرامترات المحددة. على سبيل المثال، إذا قمت بتعريف الدالة square، فستقوم بإستدعائها كما يلي :

- -
square(5);
-
- -

تقوم التعليمة البرمجية اعلاه باستدعاء الدالة مع البارامتر 5. ثم تقوم بتنفيذ التعليمات البرمجية المرتبطة بها وترجع القيمة 25.

- -

الدوال يجب ان تنتمي للنطاق الذي استدعيت فيه، ولان الدوال بصيغة function declaration ترفع اعلى النطاق، فمن الممكن أن تعرف في وقت لاحق، كما في المثال التالي:

- -
console.log(square(5));
-/* ... */
-function square(n) { return n*n }
-
- -

نطاق الدالة هو اما الدالة التي تم الإعلان عنها، أو البرنامج بأكمله إذا تم الاعلان عنها في المستوى العلوي.

- -
-

ملاحظة: سيعمل هذا فقط عندما يتم تعريف الدالة باستخدام الصيغة (مثل {}()function funcName). اما التعليمة البرمجية التالية فسوف لن تعمل، وهذا يعني ان الية الرفع (hoisting) بالنسبة للدوال تعمل فقط مع الدوال ذات الصيغة function declaration ولا تعمل مع الدوال ذات الصيغة function expression.

-
- -
console.log(square); // square is hoisted with an initial value undefined.
-console.log(square(5)); // TypeError: square is not a function
-var square = function(n) {
-  return n * n;
-}
-
- -

arguments الدالة لا تقتصر على الاعداد او السلاسل الحرفية فقط، يمكنك تمرير الكائنات ايضا. في القسم الخاص بالعمل مع الكائنات العمل مع الكائنات[عربي] توجد دالة باسم ()showProps توضح كيفية تمرير كائن ك argument للدالة.

- -

يمكن للدالة أن تقوم بإستدعاء ذاتها. على سبيل المثال، هذه الدالة تقوم بحساب المضروب بشكل متكرر :

- -
function factorial(n){
-  if ((n === 0) || (n === 1))
-    return 1;
-  else
-    return (n * factorial(n - 1));
-}
-
- -

في كل مرة تقوم الدالة باستدعاء ذاتها، يتم خصم 1 من قيمة البرامتر الممرر، ويتم ضرب القيمة المحصلة في القيمة العائدة من جديد، فرضا، اذا كانت القيمة الممررة 5، الاستدعاء الاول سيكون 5، الاستدعاء الثاني سيكون 4، الاستدعاء الثالث سيكون 3، وهكذا، ويتم ضرب هذه القيم العائدة مع بعضها البعض. بهذا الشكل :  5 * 4 * 3 * 2 * 1 == 120

- -

امثلة متنوعة:

- -
var a, b, c, d, e;
-a = factorial(1); // a gets the value 1    // 1 * 1
-b = factorial(2); // b gets the value 2    // 2 * 1
-c = factorial(3); // c gets the value 6    // 3 * 2 * 1
-d = factorial(4); // d gets the value 24   // 4 * 3 * 2 * 1
-e = factorial(5); // e gets the value 120  // 5 * 4 * 3 * 2 * 1
-
- -

هناك طرق أخرى لاستدعاء الدوال. غالبا ما تكون هناك حالات تحتاج الى دالة تُستدعى بشكل ديناميكي، حيث يمكن التعامل مع مجموعة من ال arguments، وحيث سياق (context) استدعاء الدالة يجب ان ينشا في وظيفة لكائن يحدد وقت التشغيل. وهذا يبين ان الدوال هي نفسها كائنات، وهذه الكائنات بدورها لديها وظائف ( شاهد {{jsxref("Function")}} object). من ضمن هذه الوظائف، الوظيفة {{jsxref("Function.apply", "()apply")}} يمكن استخدامها لتحقيق هذه الاهداف.

- -

نطاق الدالة

- -

المتغيرات المعرفة داخل الدالة لايمكن الوصول إليها من أي مكان آخر خارج الدالة، لأن هذه المتغيرات معرفة فقط داخل نطاق الدالة. على كل، يمكن للدالة الوصول إلى كل المتغيرات والدوال المعرفة في النطاق المعرفة فيه الدالة. بعبارة أخرى، الدالة المعرفة في النطاق العام تستطيع الوصول إلى كل المتغيرات المعرفة في النطاق العام. الدالة المعرفة داخل دالة أخرى يمكنها أيضا الوصول إلى كل المتغيرات المعرفة في دالتها الأم وكل المتغيرات الأخرى التي يمكن للدالة الأم الوصول لها.

- -
// المتغيرات التالية معرفة في النطاق العام
-var num1 = 20,
-    num2 = 3,
-    name = "Chamahk";
-
-// هذه الدالة معرفة في النطاق العام
-function multiply() {
-  return num1 * num2;
-}
-
-multiply(); // Returns 60
-
-// مثال على دالة داخل دالة
-function getScore () {
-  var num1 = 2,
-      num2 = 3;
-
-  function add() {
-    return name + " scored " + (num1 + num2);
-  }
-
-  return add();
-}
-
-getScore(); // Returns "Chamahk scored 5"
-
- -

النطاق ومكدس الدوال

- -

الاستدعاء الذاتي

- -

يمكن للدالة ان تستدعي داتها بثلاثة طرق:

- -
    -
  1. من خلال اسم الدالة
  2. -
  3. arguments.callee
  4. -
  5. من خلال المتغيرات التي تشير إلى الدالة
  6. -
- -

على سبيل المثال، انظر الدالة التالية:

- -
var foo = function bar() {
-   // statements go here
-};
-
- -

تضمين الاستدعاء الذاتي داخل جسم الدالة bar:

- -
    -
  1. ()bar
  2. -
  3. ()arguments.callee
  4. -
  5. ()foo
  6. -
- -

الدوال التي تقوم باستدعاء نفسها تسمى recursive function. الاستدعاء الداتي يشبه آلِية الحلقات في بعض النواحي، كلاهما ينفذان التعليمات البرمجية نفسها عدة مرات، وايضا كلاهما يتطلبان تعبيرا شرطيا (لتجنب التكرار الى ما لا نهاية، او بالاحرى، الاستدعاء الذاتي الى ما لا نهاية في حالتنا هذه). على سبيل المثال، الحلقة التالية:

- -
var x = 0;
-while (x < 10) { // "x < 10" is the loop condition
-   // do stuff
-   x++;
-}
-
- -

المثال التالي يبين دالة تقوم بالاستدعاء الذاتي، يمكنها محاكات الحلقة :

- -
function loop(x) {
-  if (x >= 10) // "x >= 10" is the exit condition (equivalent to "!(x < 10)")
-    return;
-  // do stuff
-  loop(x + 1); // the recursive call
-}
-loop(0);
-
- -

ومع ذلك، لا يمكن أن تكون بعض الخوارزميات حلقات تكرارية بسيطة. على سبيل المثال، الوصول الى كافة العقد nodes في بنية الشجرة DOM سيكون اسهل واكثر تفصيلا باستخدام الاستدعاء الذاتي:

- -
function walkTree(node) {
-  if (node == null) //
-    return;
-  // do something with node
-  for (var i = 0; i < node.childNodes.length; i++) {
-    walkTree(node.childNodes[i]);
-  }
-}
-
- -

على عكس الحلقات التكرارية البسيطة، والتي تقوم بالتكرار السطحي على DOM، تمكننا دوال الاستدعاء الداتي من تنفيذ عدة استدعاءات، كل استدعاء داتي ينتج عنه العديد من الاستدعاءات الفرعية، بمعنى ان هذا النوع من الدوال يمكنها الوصول الى عمق ال DOM. لتتيح لك امكانية التعامل مع كل جزئية فيه. كما يوضح المثال التالي:

- -
var walkTree = function recycle( node, fn ) {
-	fn( node );
-	node = node .firstChild;
-	while( node ){
-		recycle( node, fn );
-		node = node.nextSibling;
-	}
-}
-
-walkTree( document.body , function( node ){
-	if( node.nodeType == 1 ){
-		// do something with [object HTMLElements]
-	}
-	if( node.nodeType == 3 ){
-		// do something with [object Text]
-	}
-});
-
- -

كلا الدالتين اعلاه، تؤدي نفس الغرض، لا اختلاف بينهما، الفرق الوحيد هو شكل بناء الدالة، حيث بنيت الدالة الاولى على طريقة ال  function declaration  فيما بنيت الدالة الثانية على شكل، ال  function expression  وال  anonymous function، وكلاهما تنتهج اسلوب recursive function.

- -

من الناحية النظرية، من الممكن تحويل أي خوارزمية الاستدعاء الذاتي الى خوارزمية الاستدعاء العادي (مع الحلقات، على سبيل المثال). عموما، المنطق الناتج أكثر تعقيداً ويتطلب استخدام  المكدس. الاستدعاء الذاتي أيضا يستخدم المكدس، مكدس الدالة function stack.

- -

سلوك مكدس الذاكرة المؤقتة يمكن أن ينظر إليه كما في المثال التالي:

- -
function foo(i) {
-  if (i < 0)
-    return;
-  console.log('begin:' + i);
-  foo(i - 1);
-  console.log('end:' + i);
-}
-foo(3);
-
-// Output:
-
-// begin:3
-// begin:2
-// begin:1
-// begin:0
-// end:0
-// end:1
-// end:2
-// end:3
- -

الدوال المتداخلة  و الاغلاق (closures)

- -

يمكن انشاء دالة داخل دالة اخرى. الدالة الداخلية هي دالة خاصة private بالدالة الخارجة. الدالة الداخلية تشكل الاغلاق closure، والإغلاق هو فقط تعبير (عموما الاغلاق هو دالة). والذي يمكنه الوصول إلى المتغيرات المجانية free variables (المصطلح free variable يشير الى المتغيرات المستخدمة في الدالة، وهي ليست متغيرات محلية او بارامترات لهذه الدالة. بمعنى اخر هي متغيرات معرفة خارج الدالة وتستفيد منها الدالة، وهذا هو سبب تسميتها بالمتغيرات المجانية)،  كما يمكنه ايضا، الوصول الى اي شئ في البيئة التي ترتبط بها هذه المتغيرات المجانية.

- -

بما ان الدالة الداخلية هي closure. فهذا يعني انها تستطيع ان ترث البرامترات والمتغيرات من الدالة الخارجية. بمعنى اخر، الدالة الداخلية تمتلك النطاق الخاص بالدالة الخارجية.

- -

الخلاصة:

- - - -

يظهر المثال التالي الدوال المتداخلة:

- -
function addSquares(a,b) {
-  function square(x) {
-    return x * x;
-  }
-  return square(a) + square(b);
-}
-a = addSquares(2,3); // returns 13
-b = addSquares(3,4); // returns 25
-c = addSquares(4,5); // returns 41
-
- -

بما ان الدالة الداخلية تشكل closure. فمن الضروري استدعاء الدالة الخارجية أولا، بعد ذالك يمكنك تحديد ال  arguments لكل منهما :

- -
function outside(x) {
-  function inside(y) {
-    return x + y;
-  }
-  return inside;
-}
-fn_inside = outside(3); // Think of it like: give me a function that adds 3 to whatever you give it
-result = fn_inside(5); // returns 8
-
-result1 = outside(3)(5); // returns 8
-
- -

الحفاظ على المتغيرات

- -

في المثال اعلاه، لاحظ كيف تم الحفاظ على x عندما تم ارجاع الدالة inside. الاغلاق يحفاظ على البرامترات والمتغيرات في جميع النطاقات التي تشير إليه. مع كل استدعاء للدالة الخارجية، يمكنك تعيين arguments مختلفة، سيتم إنشاء إغلاق جديد مع كل استدعاء للدالة outside. يمكن تحرير الذاكرة فقط عندما يكون عائد الدلة inside غير متاحا.

- -

وهذا لا يختلف عن تخزين المراجع في كائنات أخرى، ولكن غالبا ما يكون أقل وضوحاً نظراً لعدم تعيين المراجع مباشرة ولا يمكن فحصها.

- -

الدوال الاكثر تداخلا

- -

الدوال يمكن ان تكون اكثر تداخلا، بمعنى، الدالة (A) تحتضن الدالة (B)، والدالة (B) تحتضن الدالة (C). هنا كل من الدالة B و C تشكل closures، وهكذا B يمكنها الوصول الى  A، و  C يمكنها الوصول الى B. بالاضافة الى ذالك، C يمكنها الوصول الى B و A، وبالتالي، الإغلاق يمكن أن يحتوي على عدة نطاقات. وهذا ما يسمى بسلسلة النطاق scope chaining. (سيتم شرح لماذا يطلق عليه "تسلسل" في وقت لاحق).

- -

انظر في المثال التالي:

- -
function A(x) {
-  function B(y) {
-    function C(z) {
-      console.log(x + y + z);
-    }
-    C(3);
-  }
-  B(2);
-}
-A(1); // logs 6 (1 + 2 + 3)
-
- -

في هذا المثال C تصل الى y الخاصة ب B وايضا الى x الخاصة ب A، أصبح هذا ممكناً لأن:

- -
    -
  1. B تشكل closure، وتمتلك A، بمعنى B يمكنها الوصول الى البارامترات والمتغيرات الخاصة ب A.
  2. -
  3. C تشكل closure، وتمتلك B.
  4. -
  5. بسبب ان B تمتلك A، فقد اصبح C يمتلك A، وعليه ف C يمكنه الوصول الى البارامترات والمتغيرات الخاصة ب B و A. بعبارات أخرى، C سلسلة نطاقات ل B و A في هذا الترتيب.
  6. -
- -

العكس ليس صحيحاً. A لا يمكنها الوصول الى C، لان A لا يمكنها الوصول لاي من البارامترات او المتغيرات الخاصة ب B. (فيما C هي متغير لها). وهكذا، C ستصبح خاصة private فقط ب B.

- -

تضارب الاسماء

- -

عند وجود اثنين من البارامترات أو المتغيرات التي تحمل نفس الاسم في نطاقات الاغلاق، فهذا يسمى تضارب في الاسماء، وفي هذه الحالة، ستكون الاسبقية للنطاقات الاكثر عمقا في استخدام هذا الاسم، اما بالنسبة للنطاقات الأكثر سطحية سوف تحظى بأولوية أدنى لاستخدام هذا الاسم، من وجهة نظر سلسلة النطاق، النطاق الاول في السلسلة هو النطاق الاكثر عمقا ( اسفل السلسلة)، والنطاق الاخير في السلسلة هو النطاق الاكثر سطحية (اعلى السلسلة). شاهد المثال التالي:

- -
function outside() {
-  var x = 10;
-  function inside(x) {
-    return x;
-  }
-  return inside;
-}
-result = outside()(20); // returns 20 instead of 10
-
- -

يحدث تعارض الاسم  في التعليمة return x، وهو مابين الباراميتر x الخاص ب inside وبين المتغير x الخاص ب outside. سلسلة النطاق سترى الامر على هذا النحو {inside, outside, global object}. وبناءا عليه x الخاص ب inside سياخد الاسبقية على x الخاص ب outside، وبالتالي الناتج هو 20 (inside x) بدلا من 10 (outside x).

- -

الاغلاقات - Closures

- -

الإغلاق هي واحدة من أقوى المميزات في جافا سكريبت. جافا سكريبت تسمح بتداخل الوظائف وتمنح الدوال الداخلية حق الوصول الكامل إلى كافة المتغيرات والدوال المعرفة داخل الدالة الخارجية (وجميع المتغيرات والدوال الأخرى التي يمكن للدالة الخارجية الوصول إليها). ومع ذالك، الدوال الخارجية لا يمكنها الوصول الى المتغيرات والدوال المعرفة داخل الدوال الداخلية. وهذا يوفر نوعا من الحماية للمتغيرات والدوال الداخلية. وأيضا، لأن الدوال الداخلية لديها حق الوصول إلى نطاق الدالة الخارجية، فالمتغيرات والدوال المعرفة داخل الدالة الخارجية ستدوم اطول من مدة تنفيذ الدالة الخارجىة، اذا تمكنت الدالة الداخلية ان تدوم أطول من الدالة الخارجية. يتم إنشاء الاغلاق عندما تكون الدالة الداخلية بطريقة أو بأخرى في متناول أي نطاق خارج الدالة الخارجية.

- -
var pet = function(name) {   // The outer function defines a paramrter called "name"
-  var getName = function() {
-    return name;             // The inner function has access to the "name" paramrter of the outer function
-  }
-  return getName;            // Return the inner function, thereby exposing it to outer scopes
-},
-myPet = pet("Vivie");
-
-myPet();                     // Returns "Vivie"
-
- -

من الناحية العملية، يمكن أن تكون المسالة أكثر تعقيداً من التعليمات البرمجية أعلاه. يمكن إرجاع كائن والذي سيحتوي على وظائف للتعامل مع المتغيرات الداخلية للدالة الخارجية:

- -
var createPet = function(name) {
-  var sex;
-
-  return {
-    setName: function(newName) {
-      name = newName;
-    },
-
-    getName: function() {
-      return name;
-    },
-
-    getSex: function() {
-      return sex;
-    },
-
-    setSex: function(newSex) {
-      if(typeof newSex === "string" && (newSex.toLowerCase() === "male" || newSex.toLowerCase() === "female")) {
-        sex = newSex;
-      }
-    }
-  }
-}
-
-var pet = createPet("Vivie");
-pet.getName();                  // Vivie
-
-pet.setName("Oliver");
-pet.setSex("male");
-pet.getSex();                   // male
-pet.getName();                  // Oliver
-
- -

في التعليمات البرمجية اعلاه، المتغير name الخاص بالدالة الخارجية يمكن الوصول اليه من الدوال الداخلية. من المعلوم ايضا، انه، ليس هناك طريقة أخرى للوصول إلى المتغيرات الداخلية إلا من خلال الدوال الداخلية. المتغيرات الداخلية الخاصة بالدوال االداخلية هي بمثابة مخازن آمنة بالنسبة للبارامترات و المتغيرات الخارجية. كما انها تتيح امكانية الوصول الى البيانات الداخلية بشكل دقيق وامن. بالنسبة للدوال، ليس من الضروري تعيينها إلى متغير أو حتى تسميتها.

- -
var getCode = (function(){
-  var secureCode = "0]Eal(eh&2";    // A code we do not want outsiders to be able to modify...
-
-  return function () {
-    return secureCode;
-  };
-})();
-
-getCode();    // Returns the secureCode
-
- -

ومع ذلك، يجب الاحتراس جيدا من الوقوع في بعض الفخاخ عند استخدام عمليات الإغلاق. إذا كانت دالة مغلقة تعرف متغير بنفس الاسم، كاسم متغير في النطاق الخارجي، فلا توجد طريقة للإشارة إلى المتغير في النطاق الخارجي مرة أخرى.

- -
var createPet = function(name) {  // Outer function defines a variable called "name"
-  return {
-    setName: function(name) {    // Enclosed function also defines a variable called "name"
-      name = name;               // ??? How do we access the "name" defined by the outer function ???
-    }
-  }
-}
-
- -

الكلمة المحجوزة this (في بعض الاحيان تسمى بالمتغير العجيب)، ينبغي التعامل معها بحذر في حالات الإغلاق. احذر، ف this تشير إلى السياق حيث سيتم استدعاء الدالة وليس إلى المكان حيث تم تعريف الدالة.

- -

استخدام الكائن arguments

- -

يمكنك التعامل مع  arguments الدالة من الداخل، من خلال الكائن (arguments او الحجج). يمكنك معالجة ال  arguments الممررة الى الدالة على النحو التالي:

- -
arguments[i]
-
- -

حيث ان i هو الفهرس الرقمي لل arguments، ويبتدئ من 0، وبالتالي، ال argument الاول الممرر الى الدالة سيكون arguments[0]. لمعرفة عدد ال arguments الممررة نستخدم arguments.length.

- -

باستخدام الكائن arguments، يمكنك استدعاء دالة مع arguments أكثر من التي تم التصريح بها رسميا. وهي مفيذة جدا، خصوصا إذا كنت لا تعرف مسبقاً كم عدد ال  arguments التي ستمرر اثناء استدعاء الدالة. يمكنك استخدام arguments.length لمعرفة عدد البرامترات الممرة الى الدالة، حتى تتمكن بعد ذالك من التعامل معها من خلال الكائن arguments.

- -

على سبيل المثال، يمكننا انشاء دالة تقوم بوصل عدة سلاسل حرفية. ال argument الوحيد المحدد رسميا في الدالة، هو السلسلة الحرفية التي ستفصل بين باقي السلاسل الحرفية التي ستمرر ك arguments بعد ال argument الرسمي للدالة.  كما في المثال التالي:

- -
function myConcat(separator) {
-   var result = "", // initialize list
-       i;
-   // iterate through arguments
-   for (i = 1; i < arguments.length; i++) {
-      result += arguments[i] + separator;
-   }
-   return result;
-}
-
- -

يمكنك تمرير اي عدد من ال arguments لهذه الدالة، وسترتبط ببعضها البعض من خلال ما سيمرر الى ال argument الرسمي:

- -
// returns "red, orange, blue, "
-myConcat(", ", "red", "orange", "blue");
-
-// returns "elephant; giraffe; lion; cheetah; "
-myConcat("; ", "elephant", "giraffe", "lion", "cheetah");
-
-// returns "sage. basil. oregano. pepper. parsley. "
-myConcat(". ", "sage", "basil", "oregano", "pepper", "parsley");
-
- -
-

ملاحظة: المتغير arguments هو شبه مصفوفة، ولكنه ليس مصفوفة. وانما يتصرف كالمصفوفة، يستخدم الفهرسة الرقمية، يستخدم الخاصية length، ومع ذالك، لا يمكنه استخدام الوظائف الخاصة بالمصفوفات مثل push او join ...الخ.

-
- -

الفرق بين parameters و arguments

- -

Function parameters او بارامترات الدالة، هي الأسماء المدرجة في تعريف الدالة. فيما Function arguments هي القيم الحقيقية التي تمرر إلى الدالة عند الاستدعاء (راجع التعريف والاستدعاء اعلى الصفحة). انظر المثال التالي:

- -
function foo( param1, param2, ...) // parameters {
-    // Do things
-}
-foo(arg1, arg2, ...); // arguments
-
- -
-

ملاحظة: ال parameter هو متغير باسم معين يمرر الى الدالة. تستخدم الباراميترات لجلب ال arguments داخل الدوال.

-
- -

راجع الكائن {{jsxref("Function")}} في مرجع الجافا سكريبت لمزيد من المعلومات.

- -

بارامترات الدالة

- -

بدأً من ECMAScript 6، أصبح هناك نوعان من البارامترات: البارامترات الإفتراضية وبقية البارامترات.

- -

البارامترات الإفتراضية

- -

في الجافاسكريبت، القيمة الافتراضية لبرامترات الدوال هي undefined. ومع ذالك، في بعض الحالات، قد يكون من المفيد تعيين قيمة افتراضية مختلفة. البارامترات الافتراضية يمكنها تدارك الموقف.

- -

قبل ECMAScript 2015، كانت الاستراتيجية العامة لوضع الافتراضات هي اختبار قيمة البارامتر في جسم الدالة وتعيين قيمة له اذا كانت قيمته undefined. على سبيل المثال، في التعليمة البرمجية التالية، لم يتم تحديد قيمة للبارامتر b في الاستدعاء، وبالتالي قيمتة ستساوي undefined، عند اختبار (a * b) ستعود الدالة multiply ب NaN. لتجنب هذا،  يقوم السطر الثاني في التعليمة البرمجية اسفله بتعيين قيمة افتراضية للبارامتر b:

- -
function multiply(a, b) {
-  b = typeof b !== 'undefined' ?  b : 1;
-
-  return a*b;
-}
-
-multiply(5); // 5
-
- -

ابتداءا من ECMAScript 2015، اصبح من الممكن عمل اعدادات افتراضية على غرار (php)، والاختبار في جسم الدالة لم يعد ضروريا. الان، ببساطة يمكنك تعيين 1 كقيمة افتراضية للبارامتر b في تعريف الدالة:

- -
function multiply(a, b = 1) {
-  return a*b;
-}
-
-multiply(5); // 5
- -

لمزيد من التفاصيل، راجع  default parameters في مرجع الجافاسكريبت.

- -

بقية البارامترات - rest parameter

- -

الصيغة rest parameter تسمح بتمثيل عدد غير محدود من ال arguments كمصفوفة. في هذا المثال، نستخدم بقية البارامترات لتجميع ال arguments ابتداءا من البرامتر الثاني لغاية النهاية. ثم نقوم بضربها باول بارامتر. هذا المثال يستخدم دالة السهم، والتي سندرسها في القسم التالي.

- -
function multiply(multiplier, ...theArgs) {
-  return theArgs.map(x => multiplier * x);
-}
-
-var arr = multiply(2, 1, 2, 3);
-console.log(arr); // [2, 4, 6]
- -

دوال السهم - Arrow functions

- -

تعبيرات دوال السهم تسمح لك باستخدام تعبيرا أكثر إيجازاً من التعبير عن الوظائف الكلاسيكية. والقيمة this يتم ربطها بشكل نحوي. فيما تكون دوال السهم مجهولة الاسم anonymous. راجع ايضا هذه المدونة  ES6 In Depth: Arrow functions.

- -

اثنين من العوامل التي أثرت في مقدمة دوال السهم: الدوال المختصرة و lexical this.

- -

الدوال المختصرة

- -

في بعض الأنماط الوظيفية، الدوال المختصرة هي موضع ترحيب. قارن التعليمات البرمجية التالية:

- -
var a = [
-  "Hydrogen",
-  "Helium",
-  "Lithium",
-  "Beryl­lium"
-];
-
-var a2 = a.map(function(s){ return s.length });
-
-var a3 = a.map( s => s.length );
- -

التعليمة Lexical this

- -

قبل وجود وظائف السهم، كانت كل دالة جديدة تعرف قيمة ال this الخاصة بها (كائن جديد في حالة الدالة الإنشائية، undefined في استدعاءات الدوال مع الوضع الصارم، في سياق الكائن قيد التشغيل في حالة الوظيفة، إلخ.). وهذا يمكن أن يسبب بعض المشاكل مع نمط البرمجة الكائنية:

- -
function Person() {
-  // The Person() constructor defines 'this' as itself.
-  this.age = 0;
-
-  setInterval(function growUp() {
-    // In nonstrict mode, the growUp() function defines 'this'
-    // as the global object, which is different from the 'this'
-    // defined by the Person() constructor.
-  this.age++;
-  }, 1000);
-}
-var p = new Person();
- -

في ECMAScript 3/5، تم إصلاح هذه المشكلة عن طريق تخزير القيمة this في متغير اخر.

- -
function Person() {
-  var self = this; // Some choose `that` instead of `self`.
-                   // Choose one and be consistent.
-  self.age = 0;
-
-  setInterval(function growUp() {
-    // The callback refers to the `self` variable of which
-    // the value is the expected object.
-    self.age++;
-  }, 1000);
-}
- -

بدلا من ذلك، يمكننا إنشاء دالة ملزمة bound function بحيث تكون "احسن"  قيمة this سيتم تمريرها إلى الدالة ()growUp.

- -

دوال السهم تلتقط القيمة this من السياق المغلق (enclosing context)، لذا ستعمل التعليمة البرمجية التالية كما هو متوقع.

- -
function Person(){
-  this.age = 0;
-
-  setInterval(() => {
-    this.age++; // |this| properly refers to the person object
-  }, 1000);
-}
-
-var p = new Person();
- -

دوال معرفة مسبقا

- -

جافا سكريبت لديها العديد من الوظائف المدمجة ذات المستوى الاعلى top-level :

- -
-
{{jsxref("Global_Objects/eval", "()eval")}}
-
-

الوظيفة ()eval تستخدم لاختبار شفرة الجافا سكريبت على شكل سلسلة حرفية.

-
-
{{jsxref("Global_Objects/uneval", "()uneval")}} {{non-standard_inline}}
-
-

الوظيفة ()uneval تستخدم لانشاء سلسلة حرفية عبارة عن مصدر كود الكائن {{jsxref("Object")}}.

-
-
{{jsxref("Global_Objects/isFinite", "()isFinite")}}
-
-

الدالة العامة () isFinite تقوم بتحديد ما إذا كانت القيمة التي تم تمريرها عدد محدود. إذا لزم الأمر، يتم تحويل البارامتر إلى رقم.

-
-
{{jsxref("Global_Objects/isNaN", "()isNaN")}}
-
-

تستخدم الدالة()isNaN للتاكد من ان القيمة ليست رقمية {{jsxref("Global_Objects/NaN", "NaN")}}  ملاحظة: يمكننا ايضا استخدام {{jsxref("Number.isNaN()")}}, الجديدة في ECMAScript 6 او استخدام التعليمة typeof. كلها تادي نفس الغرض.

-
-
{{jsxref("Global_Objects/parseFloat", "()parseFloat")}}
-
-

تستخدم الدالة ()parseFloat لتحويل سلسلة حرفية الى عدد كسري.

-
-
{{jsxref("Global_Objects/parseInt", "()parseInt")}}
-
-

تستخدم الدالة ()parseInt لتحويل سلسلة حرفية الى عدد صحيح (البارامتر الثاني خاص بالتعامل مع القاعدة في الأنظمة العددية الرياضية).

-
-
{{jsxref("Global_Objects/decodeURI", "()decodeURI")}}
-
-

تستخدم الدالة ()decodeURI لفك تشفير معرف الموارد الموحد (Uniform Resource Identifier (URI التي تم إنشاؤها مسبقا من طرف {{jsxref("Global_Objects/encodeURI", "encodeURI")}} او عن طريق نفس الروتين.

-
-
{{jsxref("Global_Objects/decodeURIComponent", "()decodeURIComponent")}}
-
-

تستخدم الوظيفة ()decodeURIComponent لفك تشفير معرف عناصر الموارد الموحدة (Uniform Resource Identifier (URI التي تم إنشاؤها مسبقا من طرف {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}} او عن طريق نفس الروتين.

-
-
{{jsxref("Global_Objects/encodeURI", "()encodeURI")}}
-
-

تستخدم الوظيفة ()encodeURI لتشفير معرف الموارد الموحد (Uniform Resource Identifier (URI باستبدال كل مثيل من أحرف معينة بواحد، اثنان، ثلاثة، أو أربعة تهريبات متوالية تمثل ترميز الاحرف UTF-8 (لن يكون إلا أربع تهريبات متوالية لرموز تتألف من اثنين من الحروف "البديلة").

-
-
{{jsxref("Global_Objects/encodeURIComponent", "()encodeURIComponent")}}
-
-

تستخدم الوظيفة ()encodeURIComponent لتشفير معرف عناصر الموارد الموحدة (Uniform Resource Identifier (URI باستبدال كل مثيل من أحرف معينة بواحد، اثنان، ثلاثة، أو أربعة تهريبات متوالية تمثل ترميز الاحرف UTF-8 (لن يكون إلا أربع تهريبات متوالية لاحرف تتألف من اثنين من الحروف "البديلة").

-
-
{{jsxref("Global_Objects/escape", "()escape")}} {{deprecated_inline}}
-
-

الوظيفة ()escape الغير مرغوب فيها. تحتسب سلسلة جديدة من بعض الأحرف التي يجب استبدلها من قبل hexadecimal escape sequence. استخدم {{jsxref("Global_Objects/encodeURI", "encodeURI")}} او استخدم {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}} بدلا عنها.

-
-
{{jsxref("Global_Objects/unescape", "()unescape")}} {{deprecated_inline}}
-
-

الوظيفة()unescape الغير مرغوب فيها. تحتسب سلسلة جديدة بحيث hexadecimal escape sequence. اسبدلت مع الرمز الذي يمثلها. متتالية التهريب يمكن ان تاتى من دالة مثل {{jsxref("Global_Objects/escape", "escape")}}. على العموم استخدم {{jsxref("Global_Objects/decodeURI", "decodeURI()")}} او استخدم {{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent")}} بدلا عنها.

-
-
- -

 

-
- -

{{PreviousNext("Web/JavaScript/Guide/Loops_and_iteration", "Web/JavaScript/Guide/Expressions_and_Operators")}}

-- cgit v1.2.3-54-g00ecf From 4923a64dd55704e9adaf5e4c635ca04d7fb2beed Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:44:35 +0100 Subject: unslug ar: modify --- files/ar/_redirects.txt | 69 +- files/ar/_wikihistory.json | 738 ++++++++++----------- .../conflicting/learn/css/first_steps/index.html | 5 +- files/ar/conflicting/learn/css/index.html | 3 +- .../learn/getting_started_with_the_web/index.html | 3 +- .../learn/javascript/objects/index.html | 3 +- files/ar/conflicting/web/guide/index.html | 3 +- files/ar/conflicting/web/html/element/index.html | 3 +- files/ar/conflicting/web/html/index.html | 3 +- files/ar/glossary/character/index.html | 3 +- files/ar/glossary/first-class_function/index.html | 3 +- files/ar/glossary/object/index.html | 3 +- files/ar/glossary/property/index.html | 3 +- files/ar/glossary/scope/index.html | 3 +- .../how_does_the_internet_work/index.html | 3 +- .../first_steps/how_css_is_structured/index.html | 3 +- .../css/styling_text/styling_lists/index.html | 3 +- files/ar/learn/forms/index.html | 3 +- .../css_basics/index.html | 3 +- files/ar/learn/html/tables/index.html | 3 +- files/ar/mdn/at_ten/index.html | 3 +- .../howto/create_and_edit_pages/index.html | 3 +- files/ar/mdn/yari/index.html | 3 +- .../what_are_webextensions/index.html | 3 +- files/ar/orphaned/heesfoord007/index.html | 3 +- .../ar/orphaned/learn/how_to_contribute/index.html | 3 +- files/ar/orphaned/mdn/community/index.html | 3 +- .../mdn/community/whats_happening/index.html | 3 +- .../howto/create_an_mdn_account/index.html | 3 +- .../howto/do_a_technical_review/index.html | 3 +- .../howto/do_an_editorial_review/index.html | 3 +- .../howto/set_the_summary_for_a_page/index.html | 3 +- .../index.html | 3 +- .../ar/orphaned/mdn/tools/page_deletion/index.html | 3 +- .../index.html" | 3 +- .../index.html" | 3 +- .../index.html" | 3 +- .../index.html" | 3 +- files/ar/web/api/geolocation_api/index.html | 3 +- .../using_the_geolocation_api/index.html | 3 +- files/ar/web/api/history_api/example/index.html | 3 +- files/ar/web/api/navigator/battery/index.html | 3 +- files/ar/web/css/comments/index.html | 3 +- .../ar/web/css/css_animated_properties/index.html | 3 +- .../basic_concepts_of_flexbox/index.html | 3 +- .../relationship_of_grid_layout/index.html | 3 +- files/ar/web/css/transform/index.html | 3 +- files/ar/web/guide/graphics/index.html | 3 +- files/ar/web/guide/mobile/index.html | 3 +- files/ar/web/html/element/article/index.html | 3 +- files/ar/web/html/element/bdo/index.html | 3 +- .../web/html/element/heading_elements/index.html | 3 +- files/ar/web/html/element/index.html | 3 +- files/ar/web/html/element/span/index.html | 3 +- files/ar/web/html/element/tt/index.html | 3 +- files/ar/web/javascript/guide/functions/index.html | 3 +- .../javascript/reference/functions/get/index.html | 3 +- .../web/javascript/reference/functions/index.html | 3 +- .../reference/global_objects/number/index.html | 3 +- files/ar/web/reference/index.html | 3 +- files/ar/web/security/index.html | 3 +- 61 files changed, 550 insertions(+), 436 deletions(-) (limited to 'files/ar/web/javascript/guide') diff --git a/files/ar/_redirects.txt b/files/ar/_redirects.txt index fde7fd632d..093014aec1 100644 --- a/files/ar/_redirects.txt +++ b/files/ar/_redirects.txt @@ -1,32 +1,87 @@ # FROM-URL TO-URL +/ar/docs/Glossary/الحروف /ar/docs/Glossary/Character +/ar/docs/Glossary/الخاصية /ar/docs/Glossary/property +/ar/docs/Glossary/الدوال_من_الدرجة_الأولى /ar/docs/Glossary/First-class_Function +/ar/docs/Glossary/الكائنات /ar/docs/Glossary/Object +/ar/docs/Glossary/المجالات /ar/docs/Glossary/Scope /ar/docs/HTML /ar/docs/Web/HTML +/ar/docs/HTML/Element /ar/docs/Web/HTML/Element +/ar/docs/HTML/Element/article /ar/docs/Web/HTML/Element/article +/ar/docs/HTML/Element/bdo /ar/docs/Web/HTML/Element/bdo +/ar/docs/HTML/Element/headings_elements /ar/docs/Web/HTML/Element/Heading_Elements +/ar/docs/HTML/Element/span /ar/docs/Web/HTML/Element/span +/ar/docs/HTML/Element/tt /ar/docs/Web/HTML/Element/tt /ar/docs/Learn/CSS/Introduction_to_CSS /en-US/docs/Learn/CSS/First_steps /ar/docs/Learn/CSS/Introduction_to_CSS/How_CSS_works /en-US/docs/Learn/CSS/First_steps/How_CSS_works /ar/docs/Learn/CSS/Introduction_to_CSS/Selectors /en-US/docs/Learn/CSS/Building_blocks/Selectors +/ar/docs/Learn/Common_questions/كيفية_عمل /ar/docs/Learn/Common_questions/How_does_the_Internet_work +/ar/docs/Learn/Getting_started_with_the_web/أساسيات_صفحات_الطرز_المتراصة /ar/docs/Learn/Getting_started_with_the_web/CSS_basics /ar/docs/Learn/Getting_started_with_the_web/أساسيات_لغة_ترميز_النص_الفائق /ar/docs/Learn/Getting_started_with_the_web/HTML_basics /ar/docs/Learn/Getting_started_with_the_web/التعامل_مع_الملفات /ar/docs/Learn/Getting_started_with_the_web/Dealing_with_files /ar/docs/Learn/Getting_started_with_the_web/تثبيت_البرمجيات_الأساسية /ar/docs/Learn/Getting_started_with_the_web/Installing_basic_software /ar/docs/Learn/Getting_started_with_the_web/كيف_يجب_أن_يبدو_موقعك /ar/docs/Learn/Getting_started_with_the_web/What_will_your_website_look_like +/ar/docs/Learn/HTML/Forms /ar/docs/Learn/Forms +/ar/docs/Learn/HTML/الجداول /ar/docs/Learn/HTML/Tables +/ar/docs/Learn/HTML/بسيطة_HTML_إنشاء_صفحة /ar/docs/conflicting/Learn/Getting_started_with_the_web /ar/docs/Learn/HTML/مقدمة_إلى_لغة_ترميز_النص_الفائق /ar/docs/Learn/HTML/Introduction_to_HTML /ar/docs/Learn/HTML/مقدمة_إلى_لغة_ترميز_النص_الفائق/Getting_started /ar/docs/Learn/HTML/Introduction_to_HTML/Getting_started /ar/docs/Learn/HTML/مقدمة_إلى_لغة_ترميز_النص_الفائق/HTML_text_fundamentals /ar/docs/Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals +/ar/docs/Learn/How_to_contribute /ar/docs/orphaned/Learn/How_to_contribute +/ar/docs/MDN/Community /ar/docs/orphaned/MDN/Community +/ar/docs/MDN/Community/Whats_happening /ar/docs/orphaned/MDN/Community/Whats_happening /ar/docs/MDN/Contribute/Guidelines /ar/docs/MDN/Guidelines /ar/docs/MDN/Contribute/Guidelines/Writing_style_guide /ar/docs/MDN/Guidelines/Writing_style_guide +/ar/docs/MDN/Contribute/Howto/Do_a_technical_review /ar/docs/orphaned/MDN/Contribute/Howto/Do_a_technical_review +/ar/docs/MDN/Contribute/Howto/Do_an_editorial_review /ar/docs/orphaned/MDN/Contribute/Howto/Do_an_editorial_review +/ar/docs/MDN/Contribute/Howto/Set_the_summary_for_a_page /ar/docs/orphaned/MDN/Contribute/Howto/Set_the_summary_for_a_page +/ar/docs/MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web /ar/docs/orphaned/MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web +/ar/docs/MDN/Contribute/Howto/إنشاء_حساب_على_شبكة_مطوري_موزيلا /ar/docs/orphaned/MDN/Contribute/Howto/Create_an_MDN_account +/ar/docs/MDN/Contribute/Howto/كيفية_إنشاء_وتحرير_الصفحات /ar/docs/MDN/Contribute/Howto/Create_and_edit_pages /ar/docs/MDN/Contribute/Tools /ar/docs/MDN/Tools -/ar/docs/MDN/Contribute/Tools/Deleting_pages /ar/docs/MDN/Tools/Deleting_pages +/ar/docs/MDN/Contribute/Tools/Deleting_pages /ar/docs/orphaned/MDN/Tools/Page_deletion /ar/docs/MDN/Feedback /ar/docs/MDN/Contribute/Feedback /ar/docs/MDN/Getting_started /ar/docs/MDN/Contribute/Getting_started +/ar/docs/MDN/Kuma /ar/docs/MDN/Yari +/ar/docs/MDN/Tools/Deleting_pages /ar/docs/orphaned/MDN/Tools/Page_deletion /ar/docs/MDN/User_guide /ar/docs/MDN/Tools -/ar/docs/MDN/User_guide/Deleting_pages /ar/docs/MDN/Tools/Deleting_pages +/ar/docs/MDN/User_guide/Deleting_pages /ar/docs/orphaned/MDN/Tools/Page_deletion +/ar/docs/MDN_at_ten /ar/docs/MDN/At_ten +/ar/docs/Mozilla/Add-ons/WebExtensions/ما_هي_امتدادات_الويب /ar/docs/Mozilla/Add-ons/WebExtensions/What_are_WebExtensions +/ar/docs/Web/API/Geolocation/Using_geolocation /ar/docs/Web/API/Geolocation_API +/ar/docs/Web/API/Geolocation/Using_geolocation/Using_the_Geolocation_API /ar/docs/Web/API/Geolocation_API/Using_the_Geolocation_API /ar/docs/Web/API/HTMLElement.contentEditable /ar/docs/Web/API/HTMLElement/contentEditable +/ar/docs/Web/API/History_API/مثال /ar/docs/Web/API/History_API/Example +/ar/docs/Web/API/Navigator.battery /ar/docs/Web/API/Navigator/battery +/ar/docs/Web/CSS/CSS_Flexible_Box_Layout/المفاهيم_الأساسية_للصندوق_المرن /ar/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox +/ar/docs/Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout_arabic /ar/docs/Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout +/ar/docs/Web/CSS/التحول /ar/docs/Web/CSS/transform +/ar/docs/Web/CSS/التعليقات /ar/docs/Web/CSS/Comments +/ar/docs/Web/CSS/العناصر_التي_يمكن_تحريكها_باستخدام_CSS_Transitions /ar/docs/Web/CSS/CSS_animated_properties +/ar/docs/Web/Guide/CSS /ar/docs/conflicting/Learn/CSS +/ar/docs/Web/Guide/CSS/Getting_started /ar/docs/conflicting/Learn/CSS/First_steps +/ar/docs/Web/Guide/CSS/Getting_started/Readable_CSS /ar/docs/Learn/CSS/First_steps/How_CSS_is_structured +/ar/docs/Web/Guide/CSS/Getting_started/القوائم /ar/docs/Learn/CSS/Styling_text/Styling_lists /ar/docs/Web/Guide/HTML /ar/docs/Learn/HTML +/ar/docs/Web/Guide/HTML/HTML5/HTML5_element_list /ar/docs/conflicting/Web/HTML/Element /ar/docs/Web/Guide/HTML/مقدمة /ar/docs/Learn/HTML/Introduction_to_HTML -/ar/docs/Web/HTML/Element /ar/docs/HTML/Element -/ar/docs/Web/HTML/Element/bdo /ar/docs/HTML/Element/bdo -/ar/docs/Web/HTML/Element/headings_elements /ar/docs/HTML/Element/headings_elements -/ar/docs/Web/HTML/Element/span /ar/docs/HTML/Element/span -/ar/docs/Web/HTML/Element/tt /ar/docs/HTML/Element/tt +/ar/docs/Web/Guide/الرسومات /ar/docs/Web/Guide/Graphics +/ar/docs/Web/HTML/Element/headings_elements /ar/docs/Web/HTML/Element/Heading_Elements +/ar/docs/Web/HTML_لغة_ترميز_النص_الفائق /ar/docs/conflicting/Web/HTML /ar/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types /ar/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types +/ar/docs/Web/JavaScript/Guide/الدوال /ar/docs/Web/JavaScript/Guide/Functions +/ar/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript /ar/docs/conflicting/Learn/JavaScript/Objects +/ar/docs/Web/JavaScript/Reference/Global_Objects/الارقام /ar/docs/Web/JavaScript/Reference/Global_Objects/Number /ar/docs/Web/JavaScript/Reference/Global_Objects/رياضيات /ar/docs/Web/JavaScript/Reference/Global_Objects/Math +/ar/docs/Web/JavaScript/Reference/الدوال /ar/docs/Web/JavaScript/Reference/Functions +/ar/docs/Web/JavaScript/Reference/الدوال/get /ar/docs/Web/JavaScript/Reference/Functions/get +/ar/docs/Web/حماية /ar/docs/Web/Security /ar/docs/Web/دروس /ar/docs/Web/Tutorials +/ar/docs/Web/مرجع. /ar/docs/Web/Reference +/ar/docs/Web_Development /ar/docs/conflicting/Web/Guide +/ar/docs/Web_Development/Mobile /ar/docs/Web/Guide/Mobile /ar/docs/en /en-US/ +/ar/docs/heesfoord007 /ar/docs/orphaned/heesfoord007 +/ar/docs/أحداث_مكتبة_jQuery /ar/docs/orphaned/أحداث_مكتبة_jQuery +/ar/docs/مكتبة_جي_كويري /ar/docs/orphaned/مكتبة_جي_كويري +/ar/docs/واصفة_SpellCheck_الجديدة_في_HTML5 /ar/docs/orphaned/واصفة_SpellCheck_الجديدة_في_HTML5 +/ar/docs/واصفة_العنوان_في_HTML /ar/docs/orphaned/واصفة_العنوان_في_HTML diff --git a/files/ar/_wikihistory.json b/files/ar/_wikihistory.json index 520f904f68..6e2ca1f741 100644 --- a/files/ar/_wikihistory.json +++ b/files/ar/_wikihistory.json @@ -276,82 +276,6 @@ "ahmadnourallah" ] }, - "Glossary/الحروف": { - "modified": "2019-03-18T20:41:14.582Z", - "contributors": [ - "moussagigawatt" - ] - }, - "Glossary/الخاصية": { - "modified": "2019-03-18T20:41:18.902Z", - "contributors": [ - "moussagigawatt" - ] - }, - "Glossary/الدوال_من_الدرجة_الأولى": { - "modified": "2019-03-18T21:43:51.692Z", - "contributors": [ - "ahmadnourallah" - ] - }, - "Glossary/الكائنات": { - "modified": "2019-03-18T21:23:58.693Z", - "contributors": [ - "ahmadnourallah", - "yagoub76" - ] - }, - "Glossary/المجالات": { - "modified": "2019-03-18T20:58:54.465Z", - "contributors": [ - "laloshify" - ] - }, - "HTML/Element": { - "modified": "2019-09-11T08:42:21.522Z", - "contributors": [ - "SphinxKnight", - "moaz_osama_okasha", - "elzoz531", - "teoli", - "HelmiHB" - ] - }, - "HTML/Element/article": { - "modified": "2020-10-15T22:31:03.274Z", - "contributors": [ - "M.M.J", - "a01273477051" - ] - }, - "HTML/Element/bdo": { - "modified": "2020-10-15T22:02:29.578Z", - "contributors": [ - "SphinxKnight", - "zidanlab" - ] - }, - "HTML/Element/headings_elements": { - "modified": "2020-10-15T22:08:39.845Z", - "contributors": [ - "SphinxKnight", - "Alhakem" - ] - }, - "HTML/Element/span": { - "modified": "2020-10-15T22:05:54.978Z", - "contributors": [ - "SphinxKnight", - "moaz_osama_okasha" - ] - }, - "HTML/Element/tt": { - "modified": "2020-10-15T22:05:53.553Z", - "contributors": [ - "SphinxKnight", - "moaz_osama_okasha" - ] - }, "Learn": { "modified": "2020-07-16T22:43:37.457Z", "contributors": [ @@ -429,13 +353,6 @@ "ahmadnourallah" ] }, - "Learn/Common_questions/كيفية_عمل": { - "modified": "2020-09-14T10:55:57.301Z", - "contributors": [ - "hichamikka", - "mestoo" - ] - }, "Learn/Front-end_web_developer": { "modified": "2020-12-09T17:02:05.907Z", "contributors": [ @@ -499,14 +416,6 @@ "jwhitlock" ] }, - "Learn/Getting_started_with_the_web/أساسيات_صفحات_الطرز_المتراصة": { - "modified": "2020-07-16T22:34:55.259Z", - "contributors": [ - "aminezouhair", - "sami-assasa", - "ahmadnourallah" - ] - }, "Learn/HTML": { "modified": "2020-07-16T22:22:14.487Z", "contributors": [ @@ -516,12 +425,6 @@ "Andrew_Pfeiffer" ] }, - "Learn/HTML/Forms": { - "modified": "2020-12-06T05:54:22.728Z", - "contributors": [ - "coderclouds2018" - ] - }, "Learn/HTML/Introduction_to_HTML": { "modified": "2020-07-16T22:22:44.780Z", "contributors": [ @@ -552,27 +455,6 @@ "ezrinjaz" ] }, - "Learn/HTML/الجداول": { - "modified": "2020-07-16T22:25:09.678Z", - "contributors": [ - "aminezouhair" - ] - }, - "Learn/HTML/بسيطة_HTML_إنشاء_صفحة": { - "modified": "2020-07-16T22:22:26.344Z", - "contributors": [ - "wbamberg", - "mubarak823", - "mhmdiaa" - ] - }, - "Learn/How_to_contribute": { - "modified": "2020-07-16T22:33:42.427Z", - "contributors": [ - "SphinxKnight", - "ahmadnourallah" - ] - }, "Learn/JavaScript": { "modified": "2020-07-16T22:29:36.627Z", "contributors": [ @@ -682,21 +564,6 @@ "ahmadnourallah" ] }, - "MDN/Community": { - "modified": "2019-03-23T22:39:46.468Z", - "contributors": [ - "wbamberg", - "ahmadnourallah", - "Jeremie", - "1071432726" - ] - }, - "MDN/Community/Whats_happening": { - "modified": "2019-06-11T03:43:32.787Z", - "contributors": [ - "aminezouhair" - ] - }, "MDN/Contribute": { "modified": "2019-03-23T23:16:50.906Z", "contributors": [ @@ -735,20 +602,6 @@ "Sheppy" ] }, - "MDN/Contribute/Howto/Do_a_technical_review": { - "modified": "2019-06-10T14:47:38.844Z", - "contributors": [ - "aminezouhair", - "wbamberg", - "ashqaljnoob" - ] - }, - "MDN/Contribute/Howto/Do_an_editorial_review": { - "modified": "2019-06-15T16:26:58.954Z", - "contributors": [ - "aminezouhair" - ] - }, "MDN/Contribute/Howto/Report_a_problem": { "modified": "2020-01-07T12:21:22.751Z", "contributors": [ @@ -756,13 +609,6 @@ "aminezouhair" ] }, - "MDN/Contribute/Howto/Set_the_summary_for_a_page": { - "modified": "2020-02-14T19:30:29.921Z", - "contributors": [ - "a0m0rajab", - "maherv" - ] - }, "MDN/Contribute/Howto/Tag": { "modified": "2019-09-10T11:04:17.206Z", "contributors": [ @@ -776,28 +622,6 @@ "aminezouhair" ] }, - "MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web": { - "modified": "2020-02-28T22:26:02.885Z", - "contributors": [ - "aminezouhair" - ] - }, - "MDN/Contribute/Howto/إنشاء_حساب_على_شبكة_مطوري_موزيلا": { - "modified": "2019-06-11T03:35:08.931Z", - "contributors": [ - "aminezouhair", - "wbamberg", - "ahmadnourallah", - "mhmdiaa", - "Syrian-Guy" - ] - }, - "MDN/Contribute/Howto/كيفية_إنشاء_وتحرير_الصفحات": { - "modified": "2019-03-18T21:28:07.470Z", - "contributors": [ - "AhmedElhatem" - ] - }, "MDN/Guidelines": { "modified": "2020-09-30T15:27:52.369Z", "contributors": [ @@ -813,15 +637,6 @@ "maherv" ] }, - "MDN/Kuma": { - "modified": "2019-09-09T15:51:34.712Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "ahmadnourallah", - "dr-m1991" - ] - }, "MDN/Tools": { "modified": "2020-09-30T16:47:53.767Z", "contributors": [ @@ -831,22 +646,6 @@ "Sheppy" ] }, - "MDN/Tools/Deleting_pages": { - "modified": "2020-09-30T16:47:53.745Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "Jeremie", - "Bettr", - "iii59300" - ] - }, - "MDN_at_ten": { - "modified": "2019-03-23T22:44:47.432Z", - "contributors": [ - "M.IRAQY999" - ] - }, "Mozilla": { "modified": "2019-03-23T23:28:10.569Z", "contributors": [ @@ -914,12 +713,6 @@ "ralshammrei" ] }, - "Mozilla/Add-ons/WebExtensions/ما_هي_امتدادات_الويب": { - "modified": "2020-01-01T17:57:33.756Z", - "contributors": [ - "Anonymous" - ] - }, "Mozilla/Developer_guide": { "modified": "2019-03-23T22:03:05.275Z", "contributors": [ @@ -1099,19 +892,6 @@ "fscholz" ] }, - "Web/API/Geolocation/Using_geolocation": { - "modified": "2019-08-31T16:04:10.213Z", - "contributors": [ - "1043465747", - "elsisi" - ] - }, - "Web/API/Geolocation/Using_geolocation/Using_the_Geolocation_API": { - "modified": "2020-03-22T20:37:24.802Z", - "contributors": [ - "i7cn" - ] - }, "Web/API/HTMLElement": { "modified": "2019-03-23T23:00:29.058Z", "contributors": [ @@ -1132,25 +912,12 @@ "iJianHuang" ] }, - "Web/API/History_API/مثال": { - "modified": "2019-03-23T22:22:46.391Z", - "contributors": [ - "atefBB" - ] - }, "Web/API/Navigator": { "modified": "2019-03-23T22:15:21.162Z", "contributors": [ "Sheppy" ] }, - "Web/API/Navigator.battery": { - "modified": "2019-03-23T23:12:40.096Z", - "contributors": [ - "jsx", - "Syrian-Guy" - ] - }, "Web/API/Node": { "modified": "2020-10-15T22:29:49.949Z", "contributors": [ @@ -1222,12 +989,6 @@ "vnctdj" ] }, - "Web/CSS/CSS_Flexible_Box_Layout/المفاهيم_الأساسية_للصندوق_المرن": { - "modified": "2020-03-28T05:18:29.446Z", - "contributors": [ - "Mutazalhawash" - ] - }, "Web/CSS/CSS_Grid_Layout": { "modified": "2019-03-18T21:35:22.946Z", "contributors": [ @@ -1235,12 +996,6 @@ "rachelandrew" ] }, - "Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout_arabic": { - "modified": "2019-03-18T21:35:18.134Z", - "contributors": [ - "harchaoui" - ] - }, "Web/CSS/CSS_Writing_Modes": { "modified": "2019-03-23T22:03:16.266Z", "contributors": [ @@ -1272,24 +1027,6 @@ "AF555" ] }, - "Web/CSS/التحول": { - "modified": "2020-10-15T22:06:18.420Z", - "contributors": [ - "mohamadlounnas" - ] - }, - "Web/CSS/التعليقات": { - "modified": "2019-03-23T22:09:00.996Z", - "contributors": [ - "Abu3safeer" - ] - }, - "Web/CSS/العناصر_التي_يمكن_تحريكها_باستخدام_CSS_Transitions": { - "modified": "2019-03-23T22:09:06.742Z", - "contributors": [ - "Abu3safeer" - ] - }, "Web/Events": { "modified": "2020-07-05T11:11:44.298Z", "contributors": [ @@ -1304,32 +1041,6 @@ "Sheppy" ] }, - "Web/Guide/CSS": { - "modified": "2019-03-23T23:26:10.869Z", - "contributors": [ - "Sheppy" - ] - }, - "Web/Guide/CSS/Getting_started": { - "modified": "2019-03-23T22:26:23.175Z", - "contributors": [ - "wjinca" - ] - }, - "Web/Guide/CSS/Getting_started/Readable_CSS": { - "modified": "2019-03-23T22:26:15.891Z", - "contributors": [ - "atefBB", - "Muhnad" - ] - }, - "Web/Guide/CSS/Getting_started/القوائم": { - "modified": "2019-03-23T22:26:05.454Z", - "contributors": [ - "atefBB", - "EmanShaltoutTrend" - ] - }, "Web/Guide/HTML/HTML5": { "modified": "2020-10-19T18:49:26.722Z", "contributors": [ @@ -1340,26 +1051,10 @@ "John.Smith" ] }, - "Web/Guide/HTML/HTML5/HTML5_element_list": { - "modified": "2019-03-23T23:14:56.560Z", + "Web/HTML": { + "modified": "2019-09-11T08:59:54.831Z", "contributors": [ - "Abu3safeer", - "atefBB", - "mohamedmahmoud", - "teoli", - "Ali.Talib" - ] - }, - "Web/Guide/الرسومات": { - "modified": "2019-03-18T21:43:50.204Z", - "contributors": [ - "ahmadnourallah" - ] - }, - "Web/HTML": { - "modified": "2019-09-11T08:59:54.831Z", - "contributors": [ - "SphinxKnight" + "SphinxKnight" ] }, "Web/HTML/Element/input": { @@ -1374,15 +1069,6 @@ "mhayajneh" ] }, - "Web/HTML_لغة_ترميز_النص_الفائق": { - "modified": "2019-09-11T08:10:23.337Z", - "contributors": [ - "SphinxKnight", - "aminezouhair", - "ahmadnourallah", - "antaraz" - ] - }, "Web/HTTP": { "modified": "2019-12-23T16:16:43.680Z", "contributors": [ @@ -1507,21 +1193,6 @@ "SphinxKnight" ] }, - "Web/JavaScript/Guide/الدوال": { - "modified": "2020-03-12T19:44:03.918Z", - "contributors": [ - "Youssef-Belmeskine", - "Benseidseid" - ] - }, - "Web/JavaScript/Introduction_to_Object-Oriented_JavaScript": { - "modified": "2020-03-12T19:44:59.681Z", - "contributors": [ - "HeSoKa05", - "Youssef-Belmeskine", - "mustafasalah" - ] - }, "Web/JavaScript/Reference": { "modified": "2020-03-12T19:39:44.947Z", "contributors": [ @@ -1695,12 +1366,6 @@ "Mourad_Ouchane" ] }, - "Web/JavaScript/Reference/Global_Objects/الارقام": { - "modified": "2020-10-10T09:54:31.841Z", - "contributors": [ - "Flemer" - ] - }, "Web/JavaScript/Reference/Operators": { "modified": "2020-12-14T11:30:35.207Z", "contributors": [ @@ -1750,18 +1415,6 @@ "skarfstri" ] }, - "Web/JavaScript/Reference/الدوال": { - "modified": "2020-03-12T19:44:04.047Z", - "contributors": [ - "Benseidseid" - ] - }, - "Web/JavaScript/Reference/الدوال/get": { - "modified": "2020-10-15T22:32:22.148Z", - "contributors": [ - "abdwfawzy985" - ] - }, "Web/MathML": { "modified": "2019-03-23T22:01:47.703Z", "contributors": [ @@ -1790,61 +1443,408 @@ "antaraz" ] }, - "Web/حماية": { - "modified": "2019-09-10T16:31:27.104Z", + "Glossary/Character": { + "modified": "2019-03-18T20:41:14.582Z", + "contributors": [ + "moussagigawatt" + ] + }, + "Glossary/property": { + "modified": "2019-03-18T20:41:18.902Z", + "contributors": [ + "moussagigawatt" + ] + }, + "Glossary/First-class_Function": { + "modified": "2019-03-18T21:43:51.692Z", + "contributors": [ + "ahmadnourallah" + ] + }, + "Glossary/Object": { + "modified": "2019-03-18T21:23:58.693Z", + "contributors": [ + "ahmadnourallah", + "yagoub76" + ] + }, + "Glossary/Scope": { + "modified": "2019-03-18T20:58:54.465Z", + "contributors": [ + "laloshify" + ] + }, + "orphaned/heesfoord007": { + "modified": "2019-03-23T22:50:44.174Z", + "contributors": [ + "heesfoord007" + ] + }, + "Web/HTML/Element/article": { + "modified": "2020-10-15T22:31:03.274Z", + "contributors": [ + "M.M.J", + "a01273477051" + ] + }, + "Web/HTML/Element/bdo": { + "modified": "2020-10-15T22:02:29.578Z", + "contributors": [ + "SphinxKnight", + "zidanlab" + ] + }, + "Web/HTML/Element/Heading_Elements": { + "modified": "2020-10-15T22:08:39.845Z", + "contributors": [ + "SphinxKnight", + "Alhakem" + ] + }, + "Web/HTML/Element": { + "modified": "2019-09-11T08:42:21.522Z", + "contributors": [ + "SphinxKnight", + "moaz_osama_okasha", + "elzoz531", + "teoli", + "HelmiHB" + ] + }, + "Web/HTML/Element/span": { + "modified": "2020-10-15T22:05:54.978Z", + "contributors": [ + "SphinxKnight", + "moaz_osama_okasha" + ] + }, + "Web/HTML/Element/tt": { + "modified": "2020-10-15T22:05:53.553Z", + "contributors": [ + "SphinxKnight", + "moaz_osama_okasha" + ] + }, + "Learn/Common_questions/How_does_the_Internet_work": { + "modified": "2020-09-14T10:55:57.301Z", + "contributors": [ + "hichamikka", + "mestoo" + ] + }, + "Learn/Getting_started_with_the_web/CSS_basics": { + "modified": "2020-07-16T22:34:55.259Z", + "contributors": [ + "aminezouhair", + "sami-assasa", + "ahmadnourallah" + ] + }, + "orphaned/Learn/How_to_contribute": { + "modified": "2020-07-16T22:33:42.427Z", "contributors": [ "SphinxKnight", + "ahmadnourallah" + ] + }, + "Learn/Forms": { + "modified": "2020-12-06T05:54:22.728Z", + "contributors": [ + "coderclouds2018" + ] + }, + "Learn/HTML/Tables": { + "modified": "2020-07-16T22:25:09.678Z", + "contributors": [ "aminezouhair" ] }, - "Web/مرجع.": { - "modified": "2020-09-14T07:03:21.633Z", + "MDN/At_ten": { + "modified": "2019-03-23T22:44:47.432Z", "contributors": [ - "coderclouds2018", - "ashqaljnoob07", + "M.IRAQY999" + ] + }, + "orphaned/MDN/Community": { + "modified": "2019-03-23T22:39:46.468Z", + "contributors": [ + "wbamberg", + "ahmadnourallah", + "Jeremie", + "1071432726" + ] + }, + "orphaned/MDN/Community/Whats_happening": { + "modified": "2019-06-11T03:43:32.787Z", + "contributors": [ + "aminezouhair" + ] + }, + "orphaned/MDN/Contribute/Howto/Do_a_technical_review": { + "modified": "2019-06-10T14:47:38.844Z", + "contributors": [ + "aminezouhair", + "wbamberg", + "ashqaljnoob" + ] + }, + "orphaned/MDN/Contribute/Howto/Do_an_editorial_review": { + "modified": "2019-06-15T16:26:58.954Z", + "contributors": [ + "aminezouhair" + ] + }, + "orphaned/MDN/Contribute/Howto/Set_the_summary_for_a_page": { + "modified": "2020-02-14T19:30:29.921Z", + "contributors": [ + "a0m0rajab", + "maherv" + ] + }, + "orphaned/MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web": { + "modified": "2020-02-28T22:26:02.885Z", + "contributors": [ + "aminezouhair" + ] + }, + "orphaned/MDN/Contribute/Howto/Create_an_MDN_account": { + "modified": "2019-06-11T03:35:08.931Z", + "contributors": [ + "aminezouhair", + "wbamberg", + "ahmadnourallah", + "mhmdiaa", "Syrian-Guy" ] }, - "Web_Development": { - "modified": "2019-03-23T23:25:33.143Z", + "MDN/Contribute/Howto/Create_and_edit_pages": { + "modified": "2019-03-18T21:28:07.470Z", "contributors": [ - "ethertank" + "AhmedElhatem" ] }, - "Web_Development/Mobile": { - "modified": "2019-03-23T23:25:26.627Z", + "MDN/Yari": { + "modified": "2019-09-09T15:51:34.712Z", "contributors": [ - "BenB" + "SphinxKnight", + "wbamberg", + "ahmadnourallah", + "dr-m1991" ] }, - "heesfoord007": { - "modified": "2019-03-23T22:50:44.174Z", + "orphaned/MDN/Tools/Page_deletion": { + "modified": "2020-09-30T16:47:53.745Z", "contributors": [ - "heesfoord007" + "chrisdavidmills", + "wbamberg", + "Jeremie", + "Bettr", + "iii59300" + ] + }, + "Mozilla/Add-ons/WebExtensions/What_are_WebExtensions": { + "modified": "2020-01-01T17:57:33.756Z", + "contributors": [ + "Anonymous" + ] + }, + "Web/API/Geolocation_API": { + "modified": "2019-08-31T16:04:10.213Z", + "contributors": [ + "1043465747", + "elsisi" + ] + }, + "Web/API/Geolocation_API/Using_the_Geolocation_API": { + "modified": "2020-03-22T20:37:24.802Z", + "contributors": [ + "i7cn" + ] + }, + "Web/API/History_API/Example": { + "modified": "2019-03-23T22:22:46.391Z", + "contributors": [ + "atefBB" + ] + }, + "Web/API/Navigator/battery": { + "modified": "2019-03-23T23:12:40.096Z", + "contributors": [ + "jsx", + "Syrian-Guy" + ] + }, + "Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox": { + "modified": "2020-03-28T05:18:29.446Z", + "contributors": [ + "Mutazalhawash" + ] + }, + "Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout": { + "modified": "2019-03-18T21:35:18.134Z", + "contributors": [ + "harchaoui" + ] + }, + "Web/CSS/transform": { + "modified": "2020-10-15T22:06:18.420Z", + "contributors": [ + "mohamadlounnas" + ] + }, + "Web/CSS/Comments": { + "modified": "2019-03-23T22:09:00.996Z", + "contributors": [ + "Abu3safeer" + ] + }, + "Web/CSS/CSS_animated_properties": { + "modified": "2019-03-23T22:09:06.742Z", + "contributors": [ + "Abu3safeer" + ] + }, + "Web/Guide/Graphics": { + "modified": "2019-03-18T21:43:50.204Z", + "contributors": [ + "ahmadnourallah" + ] + }, + "conflicting/Web/HTML": { + "modified": "2019-09-11T08:10:23.337Z", + "contributors": [ + "SphinxKnight", + "aminezouhair", + "ahmadnourallah", + "antaraz" + ] + }, + "Web/JavaScript/Guide/Functions": { + "modified": "2020-03-12T19:44:03.918Z", + "contributors": [ + "Youssef-Belmeskine", + "Benseidseid" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Number": { + "modified": "2020-10-10T09:54:31.841Z", + "contributors": [ + "Flemer" + ] + }, + "Web/JavaScript/Reference/Functions/get": { + "modified": "2020-10-15T22:32:22.148Z", + "contributors": [ + "abdwfawzy985" + ] + }, + "Web/JavaScript/Reference/Functions": { + "modified": "2020-03-12T19:44:04.047Z", + "contributors": [ + "Benseidseid" ] }, - "أحداث_مكتبة_jQuery": { + "Web/Security": { + "modified": "2019-09-10T16:31:27.104Z", + "contributors": [ + "SphinxKnight", + "aminezouhair" + ] + }, + "Web/Reference": { + "modified": "2020-09-14T07:03:21.633Z", + "contributors": [ + "coderclouds2018", + "ashqaljnoob07", + "Syrian-Guy" + ] + }, + "orphaned/أحداث_مكتبة_jQuery": { "modified": "2019-03-23T23:08:54.898Z", "contributors": [ "Syrian-Guy" ] }, - "مكتبة_جي_كويري": { + "orphaned/مكتبة_جي_كويري": { "modified": "2019-03-23T23:08:46.056Z", "contributors": [ "Syrian-Guy" ] }, - "واصفة_SpellCheck_الجديدة_في_HTML5": { + "orphaned/واصفة_SpellCheck_الجديدة_في_HTML5": { "modified": "2019-03-23T23:11:43.327Z", "contributors": [ "Syrian-Guy" ] }, - "واصفة_العنوان_في_HTML": { + "orphaned/واصفة_العنوان_في_HTML": { "modified": "2019-03-23T23:11:41.974Z", "contributors": [ "Syrian-Guy" ] + }, + "conflicting/Learn/Getting_started_with_the_web": { + "modified": "2020-07-16T22:22:26.344Z", + "contributors": [ + "wbamberg", + "mubarak823", + "mhmdiaa" + ] + }, + "conflicting/Web/Guide": { + "modified": "2019-03-23T23:25:33.143Z", + "contributors": [ + "ethertank" + ] + }, + "Web/Guide/Mobile": { + "modified": "2019-03-23T23:25:26.627Z", + "contributors": [ + "BenB" + ] + }, + "conflicting/Learn/CSS/First_steps": { + "modified": "2019-03-23T22:26:23.175Z", + "contributors": [ + "wjinca" + ] + }, + "Learn/CSS/First_steps/How_CSS_is_structured": { + "modified": "2019-03-23T22:26:15.891Z", + "contributors": [ + "atefBB", + "Muhnad" + ] + }, + "Learn/CSS/Styling_text/Styling_lists": { + "modified": "2019-03-23T22:26:05.454Z", + "contributors": [ + "atefBB", + "EmanShaltoutTrend" + ] + }, + "conflicting/Learn/CSS": { + "modified": "2019-03-23T23:26:10.869Z", + "contributors": [ + "Sheppy" + ] + }, + "conflicting/Web/HTML/Element": { + "modified": "2019-03-23T23:14:56.560Z", + "contributors": [ + "Abu3safeer", + "atefBB", + "mohamedmahmoud", + "teoli", + "Ali.Talib" + ] + }, + "conflicting/Learn/JavaScript/Objects": { + "modified": "2020-03-12T19:44:59.681Z", + "contributors": [ + "HeSoKa05", + "Youssef-Belmeskine", + "mustafasalah" + ] } } \ No newline at end of file diff --git a/files/ar/conflicting/learn/css/first_steps/index.html b/files/ar/conflicting/learn/css/first_steps/index.html index 2bfc5c76bb..523fc257b0 100644 --- a/files/ar/conflicting/learn/css/first_steps/index.html +++ b/files/ar/conflicting/learn/css/first_steps/index.html @@ -1,10 +1,10 @@ --- title: Getting started with CSS -slug: Web/Guide/CSS/Getting_started +slug: conflicting/Learn/CSS/First_steps tags: - Beginner - CSS - - 'CSS:Getting_Started' + - CSS:Getting_Started - Guide - Needs - NeedsBeginnerUpdate @@ -14,6 +14,7 @@ tags: - Web translation_of: Learn/CSS/First_steps translation_of_original: Web/Guide/CSS/Getting_started +original_slug: Web/Guide/CSS/Getting_started ---

This tutorial introduces you to the basic features and language (the syntax) for Cascading Style Sheets (CSS). You use CSS to change the look of a structured document, such as a web page. The tutorial also includes sample exercises you can try on your own computer to see the effects of CSS and features that work in modern browsers.

The tutorial is for beginners and anyone who would like to review the basics of CSS. If you have more experience with CSS, the CSS main page lists more advanced resources.

diff --git a/files/ar/conflicting/learn/css/index.html b/files/ar/conflicting/learn/css/index.html index 2bd34295c7..134aff0622 100644 --- a/files/ar/conflicting/learn/css/index.html +++ b/files/ar/conflicting/learn/css/index.html @@ -1,6 +1,6 @@ --- title: CSS developer guide -slug: Web/Guide/CSS +slug: conflicting/Learn/CSS tags: - CSS - Guide @@ -9,6 +9,7 @@ tags: - TopicStub translation_of: Learn/CSS translation_of_original: Web/Guide/CSS +original_slug: Web/Guide/CSS ---

{{draft}}

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or other markup languages such as SVG. CSS describes how the structured elements in the document are to be rendered on screen, on paper, in speech, or on other media. The ability to adjust the document's presentation depending on the output medium is a key feature of CSS.

diff --git a/files/ar/conflicting/learn/getting_started_with_the_web/index.html b/files/ar/conflicting/learn/getting_started_with_the_web/index.html index a6cdfdf6cf..a35f58deb0 100644 --- a/files/ar/conflicting/learn/getting_started_with_the_web/index.html +++ b/files/ar/conflicting/learn/getting_started_with_the_web/index.html @@ -1,10 +1,11 @@ --- title: إنشاء صفحة HTML بسيطة -slug: Learn/HTML/بسيطة_HTML_إنشاء_صفحة +slug: conflicting/Learn/Getting_started_with_the_web tags: - البداية translation_of: Learn/Getting_started_with_the_web translation_of_original: Learn/HTML/Write_a_simple_page_in_HTML +original_slug: Learn/HTML/بسيطة_HTML_إنشاء_صفحة ---

فى هذا المقال سوف تتعلم كيق تنشئ صفحة ويب بسيطة باستخدام {{Glossary("HTML")}}

diff --git a/files/ar/conflicting/learn/javascript/objects/index.html b/files/ar/conflicting/learn/javascript/objects/index.html index 65ce0c788a..74c5fd84fb 100644 --- a/files/ar/conflicting/learn/javascript/objects/index.html +++ b/files/ar/conflicting/learn/javascript/objects/index.html @@ -1,6 +1,6 @@ --- title: مدخل إلى جافاسكريبت كائنية التوجه -slug: Web/JavaScript/Introduction_to_Object-Oriented_JavaScript +slug: conflicting/Learn/JavaScript/Objects tags: - الأفراد - البرمجة الكائنية @@ -13,6 +13,7 @@ tags: - كائن translation_of: Learn/JavaScript/Objects translation_of_original: Web/JavaScript/Introduction_to_Object-Oriented_JavaScript +original_slug: Web/JavaScript/Introduction_to_Object-Oriented_JavaScript ---
{{jsSidebar("Introductory")}}
diff --git a/files/ar/conflicting/web/guide/index.html b/files/ar/conflicting/web/guide/index.html index 051accb9a5..d85901e920 100644 --- a/files/ar/conflicting/web/guide/index.html +++ b/files/ar/conflicting/web/guide/index.html @@ -1,12 +1,13 @@ --- title: Web Development -slug: Web_Development +slug: conflicting/Web/Guide tags: - NeedsTranslation - TopicStub - Web Development translation_of: Web/Guide translation_of_original: Web_Development +original_slug: Web_Development ---

Web development comprises all aspects of developing a web site or web application.

Learn how to create anything from a simple web site to complex, highly interactive web sites featuring the latest Web technologies by perusing the articles you'll find here.

diff --git a/files/ar/conflicting/web/html/element/index.html b/files/ar/conflicting/web/html/element/index.html index 4c2a85ac03..3cccb98dbd 100644 --- a/files/ar/conflicting/web/html/element/index.html +++ b/files/ar/conflicting/web/html/element/index.html @@ -1,6 +1,6 @@ --- title: مجموعه عناصر لغة HTML5 -slug: Web/Guide/HTML/HTML5/HTML5_element_list +slug: conflicting/Web/HTML/Element tags: - اتش تي ام ال - اتش تي ام ال 5 @@ -11,6 +11,7 @@ tags: - وسوم translation_of: Web/HTML/Element translation_of_original: Web/Guide/HTML/HTML5/HTML5_element_list +original_slug: Web/Guide/HTML/HTML5/HTML5_element_list ---

كل عناصر HTML5 المعتمدة مدرجة هنا، حيث أن اسماءها تصفها ومرتبة في مجموعات حسب وظائفها.

diff --git a/files/ar/conflicting/web/html/index.html b/files/ar/conflicting/web/html/index.html index b228c2f893..2a44ef2024 100644 --- a/files/ar/conflicting/web/html/index.html +++ b/files/ar/conflicting/web/html/index.html @@ -1,7 +1,8 @@ --- title: HTML (لغة ترميز النص الفائق) -slug: Web/HTML_لغة_ترميز_النص_الفائق +slug: conflicting/Web/HTML translation_of: Web/HTML +original_slug: Web/HTML_لغة_ترميز_النص_الفائق ---
{{HTMLSidebar}}
diff --git a/files/ar/glossary/character/index.html b/files/ar/glossary/character/index.html index 47443563a1..d691ce44ce 100644 --- a/files/ar/glossary/character/index.html +++ b/files/ar/glossary/character/index.html @@ -1,7 +1,8 @@ --- title: الحروف -slug: Glossary/الحروف +slug: Glossary/Character translation_of: Glossary/Character +original_slug: Glossary/الحروف ---

الحرف هي إما "رمز" (حروف ، أرقام ، علامات ترقيم) أو "تحكم" غير طباعي (على سبيل المثال ، رمز الإرجاع أوخطّ وصل).

diff --git a/files/ar/glossary/first-class_function/index.html b/files/ar/glossary/first-class_function/index.html index 405e49ea6b..83e098f519 100644 --- a/files/ar/glossary/first-class_function/index.html +++ b/files/ar/glossary/first-class_function/index.html @@ -1,7 +1,8 @@ --- title: الدوال من الدرجة الأولى -slug: Glossary/الدوال_من_الدرجة_الأولى +slug: Glossary/First-class_Function translation_of: Glossary/First-class_Function +original_slug: Glossary/الدوال_من_الدرجة_الأولى ---

يقال عن لغة البرمجة أنها تملك دوال من الدرجة الأولى عندما تعامل هذه الدوال في تلك اللغة كأي متغير أخر. على سبيل المثال، في تلك اللغات، يمكن أن تمرر الدالة كمعامل لدالة أخرى، ويمكن أن يتم إرجاعها من قبل دالة أخرى، ويمكن تعيينها كقيمة لمتغير.

diff --git a/files/ar/glossary/object/index.html b/files/ar/glossary/object/index.html index 01f15f9478..fad54c1142 100644 --- a/files/ar/glossary/object/index.html +++ b/files/ar/glossary/object/index.html @@ -1,10 +1,11 @@ --- title: كائن -slug: Glossary/الكائنات +slug: Glossary/Object tags: - كائن - مسرد translation_of: Glossary/Object +original_slug: Glossary/الكائنات ---

الكائِن (بالإنجليزيَّة: Object) يشير إلى هيكل بيانات يحوي بيانات وتعليمات للتعامل مع البيانات. تُشير الكائِنات أحيانًا إلى أشياء حقيقيَّة، كالكائِن car أو map المُعرَّف في لعبة سباق. تُعد لغة {{glossary("JavaScript", "الجافاسكربت")}} والجافا والسي++ وبايثون وروبي من الأمثلة على لغات {{glossary("OOP","البرمجة الكائنيَّة")}}.

diff --git a/files/ar/glossary/property/index.html b/files/ar/glossary/property/index.html index 3d197d0c39..7b4aa8c321 100644 --- a/files/ar/glossary/property/index.html +++ b/files/ar/glossary/property/index.html @@ -1,7 +1,8 @@ --- title: الخاصية -slug: Glossary/الخاصية +slug: Glossary/property translation_of: Glossary/property +original_slug: Glossary/الخاصية ---

يمكن أن يكون لمصطلح الخاصية عدة معاني حسب السياق. قد يشير إلى:

diff --git a/files/ar/glossary/scope/index.html b/files/ar/glossary/scope/index.html index b2c80924a5..13d28ff8cc 100644 --- a/files/ar/glossary/scope/index.html +++ b/files/ar/glossary/scope/index.html @@ -1,7 +1,8 @@ --- title: المجالات -slug: Glossary/المجالات +slug: Glossary/Scope translation_of: Glossary/Scope +original_slug: Glossary/المجالات ---

تعبر عن سياق التنفيذ الحالي للبرنامج والذي يمكنك فيه الوصول لقيم المتغيرات والتوابع واستعمالها. فإذا تم البحث عن متغير او تابع خارج المجال (أو سياق التنفيذ) الحالي وتبين أنّه  غير موجود فلن تستطيع الوصول إليه واستعماله. وتتشكل هذه المجالات بشكل هرمي (أو دائري بشرط لايوجد دائرتين متقاطعتين وكل الدوائر محتواة في بعضها البعض) بحيث ان المجال الداخلي (أو الدائرة الداخلية) الابن يستطيع الوصول لمجال الأب (الدائرة التي تحتويه) ولكن العكس غير ممكن.

diff --git a/files/ar/learn/common_questions/how_does_the_internet_work/index.html b/files/ar/learn/common_questions/how_does_the_internet_work/index.html index 2a3cd7e46f..4fff1099e5 100644 --- a/files/ar/learn/common_questions/how_does_the_internet_work/index.html +++ b/files/ar/learn/common_questions/how_does_the_internet_work/index.html @@ -1,12 +1,13 @@ --- title: كيف يعمل الإنترنت؟ -slug: Learn/Common_questions/كيفية_عمل +slug: Learn/Common_questions/How_does_the_Internet_work tags: - الإنترنت - درس - دليل - مبتدأ translation_of: Learn/Common_questions/How_does_the_Internet_work +original_slug: Learn/Common_questions/كيفية_عمل ---
{{LearnSidebar}}
diff --git a/files/ar/learn/css/first_steps/how_css_is_structured/index.html b/files/ar/learn/css/first_steps/how_css_is_structured/index.html index f65331a2bd..53b455f460 100644 --- a/files/ar/learn/css/first_steps/how_css_is_structured/index.html +++ b/files/ar/learn/css/first_steps/how_css_is_structured/index.html @@ -1,8 +1,9 @@ --- title: Readable CSS -slug: Web/Guide/CSS/Getting_started/Readable_CSS +slug: Learn/CSS/First_steps/How_CSS_is_structured translation_of: Learn/CSS/Introduction_to_CSS/Syntax#Beyond_syntax_make_CSS_readable translation_of_original: Web/Guide/CSS/Getting_started/Readable_CSS +original_slug: Web/Guide/CSS/Getting_started/Readable_CSS ---

{{ CSSTutorialTOC() }}

diff --git a/files/ar/learn/css/styling_text/styling_lists/index.html b/files/ar/learn/css/styling_text/styling_lists/index.html index 2b7fdeb726..aedafbd023 100644 --- a/files/ar/learn/css/styling_text/styling_lists/index.html +++ b/files/ar/learn/css/styling_text/styling_lists/index.html @@ -1,8 +1,9 @@ --- title: القوائم -slug: Web/Guide/CSS/Getting_started/القوائم +slug: Learn/CSS/Styling_text/Styling_lists translation_of: Learn/CSS/Styling_text/Styling_lists translation_of_original: Web/Guide/CSS/Getting_started/Lists +original_slug: Web/Guide/CSS/Getting_started/القوائم ---

{{ CSSTutorialTOC() }}

diff --git a/files/ar/learn/forms/index.html b/files/ar/learn/forms/index.html index 3c8f449476..ab44f3ea1f 100644 --- a/files/ar/learn/forms/index.html +++ b/files/ar/learn/forms/index.html @@ -1,6 +1,6 @@ --- title: نماذج HTML -slug: Learn/HTML/Forms +slug: Learn/Forms tags: - Beginner - Featured @@ -13,6 +13,7 @@ tags: - TopicStub - Web translation_of: Learn/Forms +original_slug: Learn/HTML/Forms ---
{{LearnSidebar}}
diff --git a/files/ar/learn/getting_started_with_the_web/css_basics/index.html b/files/ar/learn/getting_started_with_the_web/css_basics/index.html index 70be221b32..e66e1abb24 100644 --- a/files/ar/learn/getting_started_with_the_web/css_basics/index.html +++ b/files/ar/learn/getting_started_with_the_web/css_basics/index.html @@ -1,6 +1,6 @@ --- title: أساسيات الـ CSS -slug: Learn/Getting_started_with_the_web/أساسيات_صفحات_الطرز_المتراصة +slug: Learn/Getting_started_with_the_web/CSS_basics tags: - CSS - تصميم @@ -8,6 +8,7 @@ tags: - مبتدأ - ويب translation_of: Learn/Getting_started_with_the_web/CSS_basics +original_slug: Learn/Getting_started_with_the_web/أساسيات_صفحات_الطرز_المتراصة ---
{{LearnSidebar}}
diff --git a/files/ar/learn/html/tables/index.html b/files/ar/learn/html/tables/index.html index 380e837a80..de12a6ae1a 100644 --- a/files/ar/learn/html/tables/index.html +++ b/files/ar/learn/html/tables/index.html @@ -1,7 +1,8 @@ --- title: جداول HTML -slug: Learn/HTML/الجداول +slug: Learn/HTML/Tables translation_of: Learn/HTML/Tables +original_slug: Learn/HTML/الجداول ---
{{LearnSidebar}}
diff --git a/files/ar/mdn/at_ten/index.html b/files/ar/mdn/at_ten/index.html index 1df4f8a024..e467484b96 100644 --- a/files/ar/mdn/at_ten/index.html +++ b/files/ar/mdn/at_ten/index.html @@ -1,7 +1,8 @@ --- title: MDN at 10 -slug: MDN_at_ten +slug: MDN/At_ten translation_of: MDN_at_ten +original_slug: MDN_at_ten --- diff --git a/files/ar/mdn/contribute/howto/create_and_edit_pages/index.html b/files/ar/mdn/contribute/howto/create_and_edit_pages/index.html index c4ab1b2bcf..f7f9f136b8 100644 --- a/files/ar/mdn/contribute/howto/create_and_edit_pages/index.html +++ b/files/ar/mdn/contribute/howto/create_and_edit_pages/index.html @@ -1,7 +1,8 @@ --- title: كيفية إنشاء وتحرير الصفحات -slug: MDN/Contribute/Howto/كيفية_إنشاء_وتحرير_الصفحات +slug: MDN/Contribute/Howto/Create_and_edit_pages translation_of: MDN/Contribute/Howto/Create_and_edit_pages +original_slug: MDN/Contribute/Howto/كيفية_إنشاء_وتحرير_الصفحات ---
{{MDNSidebar}}
diff --git a/files/ar/mdn/yari/index.html b/files/ar/mdn/yari/index.html index 8ab5de16e5..4f62570731 100644 --- a/files/ar/mdn/yari/index.html +++ b/files/ar/mdn/yari/index.html @@ -1,10 +1,11 @@ --- title: برمجية الموسوعة كوما -slug: MDN/Kuma +slug: MDN/Yari tags: - صفحة هبوط - معلومات عن الشبكة translation_of: MDN/Kuma +original_slug: MDN/Kuma ---
{{MDNSidebar}}
diff --git a/files/ar/mozilla/add-ons/webextensions/what_are_webextensions/index.html b/files/ar/mozilla/add-ons/webextensions/what_are_webextensions/index.html index b407fc48a7..e5a17da914 100644 --- a/files/ar/mozilla/add-ons/webextensions/what_are_webextensions/index.html +++ b/files/ar/mozilla/add-ons/webextensions/what_are_webextensions/index.html @@ -1,7 +1,8 @@ --- title: ما هي الامتدادات؟ -slug: Mozilla/Add-ons/WebExtensions/ما_هي_امتدادات_الويب +slug: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions translation_of: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions +original_slug: Mozilla/Add-ons/WebExtensions/ما_هي_امتدادات_الويب ---
{{AddonSidebar}}
diff --git a/files/ar/orphaned/heesfoord007/index.html b/files/ar/orphaned/heesfoord007/index.html index 18fb17ee5d..f79e7c1a1b 100644 --- a/files/ar/orphaned/heesfoord007/index.html +++ b/files/ar/orphaned/heesfoord007/index.html @@ -1,11 +1,12 @@ --- title: heesfoord007 -slug: heesfoord007 +slug: orphaned/heesfoord007 tags: - Landing - NeedsTranslation - TopicStub - Web +original_slug: heesfoord007 ---
The open Web presents incredible opportunities for developers. To take full advantage of these technologies, you need to know how to use them. Below you'll find links to our Web technology documentation.
diff --git a/files/ar/orphaned/learn/how_to_contribute/index.html b/files/ar/orphaned/learn/how_to_contribute/index.html index e53fb8f34f..c1efde80b2 100644 --- a/files/ar/orphaned/learn/how_to_contribute/index.html +++ b/files/ar/orphaned/learn/how_to_contribute/index.html @@ -1,12 +1,13 @@ --- title: كيف تساهم في قسم التعلم في الشبكة -slug: Learn/How_to_contribute +slug: orphaned/Learn/How_to_contribute tags: - توثيق - دليل - ساهم - مبتدئين translation_of: Learn/How_to_contribute +original_slug: Learn/How_to_contribute ---
{{LearnSidebar}}
diff --git a/files/ar/orphaned/mdn/community/index.html b/files/ar/orphaned/mdn/community/index.html index 5870ddd218..01a5b68eb5 100644 --- a/files/ar/orphaned/mdn/community/index.html +++ b/files/ar/orphaned/mdn/community/index.html @@ -1,9 +1,10 @@ --- title: انضم إلى مجتمع شبكة مطوري موزيلا -slug: MDN/Community +slug: orphaned/MDN/Community tags: - حول الشبكة translation_of: MDN/Community +original_slug: MDN/Community ---
{{MDNSidebar}}
{{IncludeSubNav("/ar/docs/MDN")}}
diff --git a/files/ar/orphaned/mdn/community/whats_happening/index.html b/files/ar/orphaned/mdn/community/whats_happening/index.html index 818472e420..0f45cc3fc5 100644 --- a/files/ar/orphaned/mdn/community/whats_happening/index.html +++ b/files/ar/orphaned/mdn/community/whats_happening/index.html @@ -1,7 +1,8 @@ --- title: اتبع ما يحدث -slug: MDN/Community/Whats_happening +slug: orphaned/MDN/Community/Whats_happening translation_of: MDN/Community/Whats_happening +original_slug: MDN/Community/Whats_happening ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/contribute/howto/create_an_mdn_account/index.html b/files/ar/orphaned/mdn/contribute/howto/create_an_mdn_account/index.html index 5a0a255b5d..c6485726bc 100644 --- a/files/ar/orphaned/mdn/contribute/howto/create_an_mdn_account/index.html +++ b/files/ar/orphaned/mdn/contribute/howto/create_an_mdn_account/index.html @@ -1,11 +1,12 @@ --- title: كيف تنشئ حساباً على شبكة MDN -slug: MDN/Contribute/Howto/إنشاء_حساب_على_شبكة_مطوري_موزيلا +slug: orphaned/MDN/Contribute/Howto/Create_an_MDN_account tags: - MDN Account - إنشاء حساب MDN - حساب MDN translation_of: MDN/Contribute/Howto/Create_an_MDN_account +original_slug: MDN/Contribute/Howto/إنشاء_حساب_على_شبكة_مطوري_موزيلا ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/contribute/howto/do_a_technical_review/index.html b/files/ar/orphaned/mdn/contribute/howto/do_a_technical_review/index.html index 72774721a9..97ac1b3478 100644 --- a/files/ar/orphaned/mdn/contribute/howto/do_a_technical_review/index.html +++ b/files/ar/orphaned/mdn/contribute/howto/do_a_technical_review/index.html @@ -1,7 +1,8 @@ --- title: كيفية القيام بمراجعة فنية -slug: MDN/Contribute/Howto/Do_a_technical_review +slug: orphaned/MDN/Contribute/Howto/Do_a_technical_review translation_of: MDN/Contribute/Howto/Do_a_technical_review +original_slug: MDN/Contribute/Howto/Do_a_technical_review ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/contribute/howto/do_an_editorial_review/index.html b/files/ar/orphaned/mdn/contribute/howto/do_an_editorial_review/index.html index 1ba5c000fd..71ece898d3 100644 --- a/files/ar/orphaned/mdn/contribute/howto/do_an_editorial_review/index.html +++ b/files/ar/orphaned/mdn/contribute/howto/do_an_editorial_review/index.html @@ -1,7 +1,8 @@ --- title: كيفية القيام بمراجعة تحريرية -slug: MDN/Contribute/Howto/Do_an_editorial_review +slug: orphaned/MDN/Contribute/Howto/Do_an_editorial_review translation_of: MDN/Contribute/Howto/Do_an_editorial_review +original_slug: MDN/Contribute/Howto/Do_an_editorial_review ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/contribute/howto/set_the_summary_for_a_page/index.html b/files/ar/orphaned/mdn/contribute/howto/set_the_summary_for_a_page/index.html index 7f1598cb01..13077abb15 100644 --- a/files/ar/orphaned/mdn/contribute/howto/set_the_summary_for_a_page/index.html +++ b/files/ar/orphaned/mdn/contribute/howto/set_the_summary_for_a_page/index.html @@ -1,7 +1,8 @@ --- title: How to set the summary for a page -slug: MDN/Contribute/Howto/Set_the_summary_for_a_page +slug: orphaned/MDN/Contribute/Howto/Set_the_summary_for_a_page translation_of: MDN/Contribute/Howto/Set_the_summary_for_a_page +original_slug: MDN/Contribute/Howto/Set_the_summary_for_a_page ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/contribute/howto/write_an_article_to_help_learn_about_the_web/index.html b/files/ar/orphaned/mdn/contribute/howto/write_an_article_to_help_learn_about_the_web/index.html index 1c993c9677..41f9945501 100644 --- a/files/ar/orphaned/mdn/contribute/howto/write_an_article_to_help_learn_about_the_web/index.html +++ b/files/ar/orphaned/mdn/contribute/howto/write_an_article_to_help_learn_about_the_web/index.html @@ -1,7 +1,8 @@ --- title: كيفية كتابة مقال لمساعدة الناس على التعرف على شبكة الإنترنت -slug: MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web +slug: orphaned/MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web translation_of: MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web +original_slug: MDN/Contribute/Howto/Write_an_article_to_help_learn_about_the_Web ---
{{MDNSidebar}}
diff --git a/files/ar/orphaned/mdn/tools/page_deletion/index.html b/files/ar/orphaned/mdn/tools/page_deletion/index.html index 14b1632e0a..496ab17054 100644 --- a/files/ar/orphaned/mdn/tools/page_deletion/index.html +++ b/files/ar/orphaned/mdn/tools/page_deletion/index.html @@ -1,12 +1,13 @@ --- title: Deleting pages -slug: MDN/Tools/Deleting_pages +slug: orphaned/MDN/Tools/Page_deletion tags: - Guide - MDN Meta - Page-level - Tools translation_of: MDN/Tools/Page_deletion +original_slug: MDN/Tools/Deleting_pages ---
{{MDNSidebar}}

Only MDN administrators are able to delete pages. This article explains how to request that a page be removed from MDN.

diff --git "a/files/ar/orphaned/\330\243\330\255\330\257\330\247\330\253_\331\205\331\203\330\252\330\250\330\251_jquery/index.html" "b/files/ar/orphaned/\330\243\330\255\330\257\330\247\330\253_\331\205\331\203\330\252\330\250\330\251_jquery/index.html" index bd2307f8ce..56ca59f3b5 100644 --- "a/files/ar/orphaned/\330\243\330\255\330\257\330\247\330\253_\331\205\331\203\330\252\330\250\330\251_jquery/index.html" +++ "b/files/ar/orphaned/\330\243\330\255\330\257\330\247\330\253_\331\205\331\203\330\252\330\250\330\251_jquery/index.html" @@ -1,6 +1,7 @@ --- title: أحداث مكتبة jQuery -slug: أحداث_مكتبة_jQuery +slug: orphaned/أحداث_مكتبة_jQuery +original_slug: أحداث_مكتبة_jQuery ---

تعريف

أحداث مكتبة jQuery تقوم بربط الدوال مع عنصر معين.

diff --git "a/files/ar/orphaned/\331\205\331\203\330\252\330\250\330\251_\330\254\331\212_\331\203\331\210\331\212\330\261\331\212/index.html" "b/files/ar/orphaned/\331\205\331\203\330\252\330\250\330\251_\330\254\331\212_\331\203\331\210\331\212\330\261\331\212/index.html" index 52d56021d4..45c02f275b 100644 --- "a/files/ar/orphaned/\331\205\331\203\330\252\330\250\330\251_\330\254\331\212_\331\203\331\210\331\212\330\261\331\212/index.html" +++ "b/files/ar/orphaned/\331\205\331\203\330\252\330\250\330\251_\330\254\331\212_\331\203\331\210\331\212\330\261\331\212/index.html" @@ -1,6 +1,7 @@ --- title: مكتبة jQuery -slug: مكتبة_جي_كويري +slug: orphaned/مكتبة_جي_كويري +original_slug: مكتبة_جي_كويري ---

مقدمة

jQuery هي عبارة عن مكتبة مكتوبة بلغة JavaScript.

diff --git "a/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_spellcheck_\330\247\331\204\330\254\330\257\331\212\330\257\330\251_\331\201\331\212_html5/index.html" "b/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_spellcheck_\330\247\331\204\330\254\330\257\331\212\330\257\330\251_\331\201\331\212_html5/index.html" index 2e2626d616..b42e5e3135 100644 --- "a/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_spellcheck_\330\247\331\204\330\254\330\257\331\212\330\257\330\251_\331\201\331\212_html5/index.html" +++ "b/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_spellcheck_\330\247\331\204\330\254\330\257\331\212\330\257\330\251_\331\201\331\212_html5/index.html" @@ -1,6 +1,7 @@ --- title: واصفة SpellCheck الجديدة في HTML5 -slug: واصفة_SpellCheck_الجديدة_في_HTML5 +slug: orphaned/واصفة_SpellCheck_الجديدة_في_HTML5 +original_slug: واصفة_SpellCheck_الجديدة_في_HTML5 ---

مقدمة.

diff --git "a/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_\330\247\331\204\330\271\331\206\331\210\330\247\331\206_\331\201\331\212_html/index.html" "b/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_\330\247\331\204\330\271\331\206\331\210\330\247\331\206_\331\201\331\212_html/index.html" index 5e2d92d2a0..fbaf3bc33e 100644 --- "a/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_\330\247\331\204\330\271\331\206\331\210\330\247\331\206_\331\201\331\212_html/index.html" +++ "b/files/ar/orphaned/\331\210\330\247\330\265\331\201\330\251_\330\247\331\204\330\271\331\206\331\210\330\247\331\206_\331\201\331\212_html/index.html" @@ -1,6 +1,7 @@ --- title: واصفة العنوان في HTML -slug: واصفة_العنوان_في_HTML +slug: orphaned/واصفة_العنوان_في_HTML +original_slug: واصفة_العنوان_في_HTML ---

مقدمة.

diff --git a/files/ar/web/api/geolocation_api/index.html b/files/ar/web/api/geolocation_api/index.html index a27275b2b5..74cf4c6caf 100644 --- a/files/ar/web/api/geolocation_api/index.html +++ b/files/ar/web/api/geolocation_api/index.html @@ -1,7 +1,8 @@ --- title: Using geolocation -slug: Web/API/Geolocation/Using_geolocation +slug: Web/API/Geolocation_API translation_of: Web/API/Geolocation_API +original_slug: Web/API/Geolocation/Using_geolocation ---

The geolocation API allows the user to provide their location to web applications if they so desire. For privacy reasons, the user is asked for permission to report location information.

diff --git a/files/ar/web/api/geolocation_api/using_the_geolocation_api/index.html b/files/ar/web/api/geolocation_api/using_the_geolocation_api/index.html index d696d6c9f2..86610979b0 100644 --- a/files/ar/web/api/geolocation_api/using_the_geolocation_api/index.html +++ b/files/ar/web/api/geolocation_api/using_the_geolocation_api/index.html @@ -1,7 +1,8 @@ --- title: Using the Geolocation API -slug: Web/API/Geolocation/Using_geolocation/Using_the_Geolocation_API +slug: Web/API/Geolocation_API/Using_the_Geolocation_API translation_of: Web/API/Geolocation_API/Using_the_Geolocation_API +original_slug: Web/API/Geolocation/Using_geolocation/Using_the_Geolocation_API ---
{{securecontext_header}}{{DefaultAPISidebar("Geolocation API")}}
diff --git a/files/ar/web/api/history_api/example/index.html b/files/ar/web/api/history_api/example/index.html index 1bcce72374..b31bb01cf2 100644 --- a/files/ar/web/api/history_api/example/index.html +++ b/files/ar/web/api/history_api/example/index.html @@ -1,7 +1,8 @@ --- title: مثال تصفح آجاكس -slug: Web/API/History_API/مثال +slug: Web/API/History_API/Example translation_of: Web/API/History_API/Example +original_slug: Web/API/History_API/مثال ---

هذا مثال عن موقع واب يستعمل تقنية Ajax مُكَـوَّن فقط من ثلاث صفحات (first_page.php، second_page.php  و third_page.php). لرؤية كيفية اشتغالها، رجاء، قم بصنع الملفات التالية (أو git clone https://github.com/giabao/mdn-ajax-nav-example.git)

diff --git a/files/ar/web/api/navigator/battery/index.html b/files/ar/web/api/navigator/battery/index.html index 563c6d5288..0596c21aed 100644 --- a/files/ar/web/api/navigator/battery/index.html +++ b/files/ar/web/api/navigator/battery/index.html @@ -1,6 +1,6 @@ --- title: Navigator.battery -slug: Web/API/Navigator.battery +slug: Web/API/Navigator/battery tags: - API - batter @@ -8,6 +8,7 @@ tags: - المراجع - كائن البطارية translation_of: Web/API/Navigator/battery +original_slug: Web/API/Navigator.battery ---

{{ ApiRef() }}

الملخص

diff --git a/files/ar/web/css/comments/index.html b/files/ar/web/css/comments/index.html index 4fbf59d3f9..8f7726f714 100644 --- a/files/ar/web/css/comments/index.html +++ b/files/ar/web/css/comments/index.html @@ -1,12 +1,13 @@ --- title: التعليقات -slug: Web/CSS/التعليقات +slug: Web/CSS/Comments tags: - CSS - تعليقات - مرجع - ملاحظات translation_of: Web/CSS/Comments +original_slug: Web/CSS/التعليقات ---
{{CSSRef}}
diff --git a/files/ar/web/css/css_animated_properties/index.html b/files/ar/web/css/css_animated_properties/index.html index d9a0da44f2..2af4826ad4 100644 --- a/files/ar/web/css/css_animated_properties/index.html +++ b/files/ar/web/css/css_animated_properties/index.html @@ -1,6 +1,6 @@ --- title: العناصر التي يمكن تحريكها باستخدام CSS Transitions -slug: Web/CSS/العناصر_التي_يمكن_تحريكها_باستخدام_CSS_Transitions +slug: Web/CSS/CSS_animated_properties tags: - CSS - CSS3 @@ -9,6 +9,7 @@ tags: - سلاسة - نعومة translation_of: Web/CSS/CSS_animated_properties +original_slug: Web/CSS/العناصر_التي_يمكن_تحريكها_باستخدام_CSS_Transitions ---

{{CSSRef}}

diff --git a/files/ar/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html b/files/ar/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html index c30338c62b..5556baedd5 100644 --- a/files/ar/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html +++ b/files/ar/web/css/css_flexible_box_layout/basic_concepts_of_flexbox/index.html @@ -1,7 +1,8 @@ --- title: المفاهيم الأساسية للصندوق المرن -slug: Web/CSS/CSS_Flexible_Box_Layout/المفاهيم_الأساسية_للصندوق_المرن +slug: Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox translation_of: Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox +original_slug: Web/CSS/CSS_Flexible_Box_Layout/المفاهيم_الأساسية_للصندوق_المرن ---
{{CSSRef}}
diff --git a/files/ar/web/css/css_grid_layout/relationship_of_grid_layout/index.html b/files/ar/web/css/css_grid_layout/relationship_of_grid_layout/index.html index 7ccf10282f..04cd3b6370 100644 --- a/files/ar/web/css/css_grid_layout/relationship_of_grid_layout/index.html +++ b/files/ar/web/css/css_grid_layout/relationship_of_grid_layout/index.html @@ -1,7 +1,8 @@ --- title: العلاقة بين التنسيق الشبكي وطرق التنسيق الأخرى -slug: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout_arabic +slug: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout translation_of: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout +original_slug: Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout_arabic ---

صمم التنسيق الشبكي ليعمل جنبا إلى جنب مع جميع التنسيقات الأخرى مشكلا بذلك نظاما متكاملا لإنشاءها. في هذا الدليل سوف نشرح كيف يتوافق النظام الشبكي مع التقنيات الأخرى التي كنت قد استعملتها سابقا.

diff --git a/files/ar/web/css/transform/index.html b/files/ar/web/css/transform/index.html index 93ef2bb84e..19ad672774 100644 --- a/files/ar/web/css/transform/index.html +++ b/files/ar/web/css/transform/index.html @@ -1,6 +1,6 @@ --- title: التحول (transform) -slug: Web/CSS/التحول +slug: Web/CSS/transform tags: - التحول - التحول في صفحات الطرز المتراصة @@ -8,6 +8,7 @@ tags: - صفحات الطرز المتراصة - مرجع translation_of: Web/CSS/transform +original_slug: Web/CSS/التحول ---
{{CSSRef}}
diff --git a/files/ar/web/guide/graphics/index.html b/files/ar/web/guide/graphics/index.html index 9c8335471a..34229e4441 100644 --- a/files/ar/web/guide/graphics/index.html +++ b/files/ar/web/guide/graphics/index.html @@ -1,12 +1,13 @@ --- title: الرسومات على الويب -slug: Web/Guide/الرسومات +slug: Web/Guide/Graphics tags: - رسومات - رسوميات ثلاثية الأبعاد - رسوميات ثنائية الأبعاد - كانفاس translation_of: Web/Guide/Graphics +original_slug: Web/Guide/الرسومات ---

غالباً ما تحتاج المواقع والتطبيقات لعرض الرسومات. الصور العاديّة يمكن عرضها بسهولة باستخدام العنصر {{HTMLElement("img")}}، أو بإعداد خلفيّة الصفحة باستخدام الخاصيّة {{cssxref("background-image")}}. تستطيع أيضاً إنشاء رسومات في الهواء (طافية)، أو يمكنك التلاعب بالصور بعد حدث ما. هذه المقالات توفر نظرة حول كيف يمكنك القيام بهذه الأشياء.

diff --git a/files/ar/web/guide/mobile/index.html b/files/ar/web/guide/mobile/index.html index cc288a9c45..11f17242c7 100644 --- a/files/ar/web/guide/mobile/index.html +++ b/files/ar/web/guide/mobile/index.html @@ -1,6 +1,6 @@ --- title: Mobile Web development -slug: Web_Development/Mobile +slug: Web/Guide/Mobile tags: - Mobile - NeedsTranslation @@ -8,6 +8,7 @@ tags: - Web Development translation_of: Web/Guide/Mobile translation_of_original: Web_Development/Mobile +original_slug: Web_Development/Mobile ---

Developing web sites to be viewed on mobile devices requires approaches that ensure a web site works as well on mobile devices as it does on desktop browsers. The following articles describe some of these approaches.

    diff --git a/files/ar/web/html/element/article/index.html b/files/ar/web/html/element/article/index.html index 4ffbdbe80a..ac37a279f7 100644 --- a/files/ar/web/html/element/article/index.html +++ b/files/ar/web/html/element/article/index.html @@ -1,7 +1,8 @@ --- title: عنصر المقالة
    -slug: HTML/Element/article +slug: Web/HTML/Element/article translation_of: Web/HTML/Element/article +original_slug: HTML/Element/article ---
    {{HTMLRef}}
    diff --git a/files/ar/web/html/element/bdo/index.html b/files/ar/web/html/element/bdo/index.html index ee154b30c1..5b7dd775eb 100644 --- a/files/ar/web/html/element/bdo/index.html +++ b/files/ar/web/html/element/bdo/index.html @@ -1,7 +1,8 @@ --- title: ': عنصر تجاوز النص ثنائي الاتجاه' -slug: HTML/Element/bdo +slug: Web/HTML/Element/bdo translation_of: Web/HTML/Element/bdo +original_slug: HTML/Element/bdo ---
    {{HTMLRef}}
    diff --git a/files/ar/web/html/element/heading_elements/index.html b/files/ar/web/html/element/heading_elements/index.html index acd3267d37..4770490bd3 100644 --- a/files/ar/web/html/element/heading_elements/index.html +++ b/files/ar/web/html/element/heading_elements/index.html @@ -1,7 +1,8 @@ --- title: '

    : عناصر العناوين' -slug: HTML/Element/headings_elements +slug: Web/HTML/Element/Heading_Elements translation_of: Web/HTML/Element/Heading_Elements +original_slug: HTML/Element/headings_elements ---

     عناصر <h1><h6> تقدم لنا سته مستويات من عناوين الأقسام. حيث أن العنصر<h1> يمثل العنوان الأعلى مستوى في الأهمية بينما العنصر <h2> هو الأقل.

    diff --git a/files/ar/web/html/element/index.html b/files/ar/web/html/element/index.html index a2fb5187e7..753d271820 100644 --- a/files/ar/web/html/element/index.html +++ b/files/ar/web/html/element/index.html @@ -1,7 +1,8 @@ --- title: HTML element reference -slug: HTML/Element +slug: Web/HTML/Element translation_of: Web/HTML/Element +original_slug: HTML/Element ---

    يسرد مرجع HTML هذا جميع عناصر HTML ، المحددة في HTML5 أو في مواصفات سابقة. عند تضمينها داخل أقواس زاوية ، فإنها تشكل علامات HTML : <elementname>.العناصر عبارة عن كيانات تحدد كيفية إنشاء مستندات HTML ، ونوع المحتوى الذي يجب وضعه في أي جزء من مستند HTML .

    diff --git a/files/ar/web/html/element/span/index.html b/files/ar/web/html/element/span/index.html index 79a265b804..faaf3faf7f 100644 --- a/files/ar/web/html/element/span/index.html +++ b/files/ar/web/html/element/span/index.html @@ -1,7 +1,8 @@ --- title: -slug: HTML/Element/span +slug: Web/HTML/Element/span translation_of: Web/HTML/Element/span +original_slug: HTML/Element/span ---

    و HTML <span>العنصر هو حاوية مضمنة عامة لمحتوى الصيغة، التي لا تمثل في حد ذاتها أي شيء. يمكن استخدامه لتجميع العناصر لأغراض التصميم (باستخدام classأو idالسمات) ، أو لأنها تتشارك في قيم السمات ، مثل langيجب استخدامه فقط عندما يكون أي عنصر دلالي آخر مناسبًا. <span>تشبه إلى حد كبير على <div>عنصر، ولكن <div>هو عنصر على مستوى الكتلة في حين أن <span>هو عنصر المضمنة .

    diff --git a/files/ar/web/html/element/tt/index.html b/files/ar/web/html/element/tt/index.html index 30cfcc09f9..79a788e995 100644 --- a/files/ar/web/html/element/tt/index.html +++ b/files/ar/web/html/element/tt/index.html @@ -1,7 +1,8 @@ --- title: ': The Teletype Text element (obsolete)' -slug: HTML/Element/tt +slug: Web/HTML/Element/tt translation_of: Web/HTML/Element/tt +original_slug: HTML/Element/tt ---
    {{ obsolete_header() }}
    diff --git a/files/ar/web/javascript/guide/functions/index.html b/files/ar/web/javascript/guide/functions/index.html index af934b397d..9c970e5440 100644 --- a/files/ar/web/javascript/guide/functions/index.html +++ b/files/ar/web/javascript/guide/functions/index.html @@ -1,11 +1,12 @@ --- title: الدوال -slug: Web/JavaScript/Guide/الدوال +slug: Web/JavaScript/Guide/Functions tags: - الدوال - جافا سكريبت - دليل translation_of: Web/JavaScript/Guide/Functions +original_slug: Web/JavaScript/Guide/الدوال ---
    {{jsSidebar("JavaScript Guide")}} {{PreviousNext("Web/JavaScript/Guide/Loops_and_iteration", "Web/JavaScript/Guide/Expressions_and_Operators")}}
    diff --git a/files/ar/web/javascript/reference/functions/get/index.html b/files/ar/web/javascript/reference/functions/get/index.html index d3789ba7bd..1b809b8ad3 100644 --- a/files/ar/web/javascript/reference/functions/get/index.html +++ b/files/ar/web/javascript/reference/functions/get/index.html @@ -1,7 +1,8 @@ --- title: getter -slug: Web/JavaScript/Reference/الدوال/get +slug: Web/JavaScript/Reference/Functions/get translation_of: Web/JavaScript/Reference/Functions/get +original_slug: Web/JavaScript/Reference/الدوال/get ---
    {{jsSidebar("Functions")}}
    diff --git a/files/ar/web/javascript/reference/functions/index.html b/files/ar/web/javascript/reference/functions/index.html index 368d8af03d..0f051b1c7d 100644 --- a/files/ar/web/javascript/reference/functions/index.html +++ b/files/ar/web/javascript/reference/functions/index.html @@ -1,7 +1,8 @@ --- title: الدوال -slug: Web/JavaScript/Reference/الدوال +slug: Web/JavaScript/Reference/Functions translation_of: Web/JavaScript/Reference/Functions +original_slug: Web/JavaScript/Reference/الدوال ---
    {{jsSidebar("Functions")}}
    diff --git a/files/ar/web/javascript/reference/global_objects/number/index.html b/files/ar/web/javascript/reference/global_objects/number/index.html index cb667fd3d8..7f4d5996a4 100644 --- a/files/ar/web/javascript/reference/global_objects/number/index.html +++ b/files/ar/web/javascript/reference/global_objects/number/index.html @@ -1,7 +1,8 @@ --- title: الارقام في الجافا سكربت -slug: Web/JavaScript/Reference/Global_Objects/الارقام +slug: Web/JavaScript/Reference/Global_Objects/Number translation_of: Web/JavaScript/Reference/Global_Objects/Number +original_slug: Web/JavaScript/Reference/Global_Objects/الارقام ---

     وهو كائن غلاف يستخدم لتمثيل ومعالجة الأرقام مثل  37  او 9.25 Numberمنشئ يحتوي على الثوابت وطرق للعمل مع الأرقام. يمكن تحويل قيم الأنواع الأخرى إلى أرقام باستخدام Number()الوظيفة.

    diff --git a/files/ar/web/reference/index.html b/files/ar/web/reference/index.html index fc7fd86cda..5f9ad294da 100644 --- a/files/ar/web/reference/index.html +++ b/files/ar/web/reference/index.html @@ -1,9 +1,10 @@ --- title: مرجع تكنولوجيا الويب. -slug: Web/مرجع. +slug: Web/Reference tags: - مراجع translation_of: Web/Reference +original_slug: Web/مرجع. ---

    تم بناء الويب المفتوح باستخدام عدد من التقنيات.أدناه سوف تجد روابط لمراجعنا  التي توضح كل تقنية.

    diff --git a/files/ar/web/security/index.html b/files/ar/web/security/index.html index c9c30e8ca4..70e58be06b 100644 --- a/files/ar/web/security/index.html +++ b/files/ar/web/security/index.html @@ -1,11 +1,12 @@ --- title: حماية الويب -slug: Web/حماية +slug: Web/Security tags: - Landing - Security - Web translation_of: Web/Security +original_slug: Web/حماية ---

    من الضروري ضمان أن موقع الويب أو تطبيق الويب المفتوح آمن. حتى الأخطاء البسيطة في التعليمات البرمجية الخاصة بك يمكن أن تؤدي إلى تسرب المعلومات الخاصة ، والأشخاص السيئين يحاولون إيجاد طرق لسرقة البيانات. توفر المقالات الموجهة لأمان الويب الواردة هنا معلومات قد تساعدك في تأمين موقعك ورمزه من الهجمات وسرقة البيانات.

    -- cgit v1.2.3-54-g00ecf