الفرق بين المراجعتين ل"jQuery/event/namespace"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
 
سطر 19: سطر 19:
 
<head>
 
<head>
 
   <meta charset="utf-8">
 
   <meta charset="utf-8">
   <title>event.namespace demo</title>
+
   <title>event.namespace مثال على الخاصية</title>
 
   <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
 
   <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
 
</head>
 
</head>

المراجعة الحالية بتاريخ 15:24، 5 يونيو 2018

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎event.namespace

القيمة المعادة

تُعيد كائنًا من النوع String.

الوصف

تعيد هذه الخاصية مجال الأسماء (namespace) المستخدم عند إطلاق الحدث.

event.namespace

أُضيف مع الإصدار: 1.4.3.

من المرجح أن تُستعمَل هذه الخاصية بشكل أساسي من قبل مبرمجي الإضافات الذين يرغبون في التعامل مع المهام بشكل مختلف اعتمادًا على مجال الأسماء المستخدم.

أمثلة

معرفة مجال الأسماء المستخدم عند وقوع الحدث:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>event.namespace مثال على الخاصية</title>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<button>display event.namespace</button>
<p></p>
 
<script>
$( "p" ).on( "test.something", function( event ) {
  alert( event.namespace );
});
$( "button" ).click(function( event ) {
  $( "p" ).trigger( "test.something" );
});
</script>
 
</body>
</html>

مصادر