الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

وهذا هو الكود سورس المراد التعديل عليه تابع للموضوع ارجووكم ضوري بأسرع وقت

بدأه crazy_shark87 في 26 يوليو 2008 · 0 رد · 732 مشاهدة · في قسم البرمجة بــ Javascript
مشاركة: واتساب X فيسبوك تيليجرام
#1

<!-- insert_names.html

The script in this document has an array of

names, name_list, whose values are in

alphabetic order. New names are input through

prompt. Each new name is inserted into the

name array, after which the new list is

displayed.

-->

<html>

<head>

<title>Name list </title>

</head>

<body>

<script type="text/javascript">

<!--

// The original list of names

var name_list = new Array("ahmad", "salem", "jaber", "fesal", "naser", "mohamad");

var new_name, index, last;

// Loop to get a new name and insert it

new_name = prompt("Please type a new name","")

last=name_list.lenght-1;

while (last >= 0 && name_list[last] > new_name)

{

name_list[last + 1] = name_list[last];

last = last - 1;

}

// Insert the new name into its spot in the array

name_list[last + 1] = new_name;

// Display the new array

document.write("<p><b>The new name list is:</b>",

"<br />");

for (index = 0; index < name_list.length; index++)

document.write(name_list[index], "<br />");

document.write("</p>");

//** end of the outer while loop

// -->

</script>

</body>

</html>

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…