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

القاء نظرة على هذا الكود

مغلق
بدأه VB786 في 26 يونيو 2004 · 9 رد · 919 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

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

الرجاء ممن يعرف أن يصحح الكود أو يعرف بديل له

وشكرا

index.htm
 ======
<html>
<head>
<title>Fillmore's index</title>
</head>

<frameset framespacing="0" cols="*">
    <frameset rows="88%,*">
       <frame name="mainframe"
                   src="fillm1.htm">
       <frame name="navigation"
                   src="navigate.htm">
    </frameset>

    <noframes>
       <body>
             <!-- This text is displayed in browser
             that does not support frames -->
             <p>Your browser does not support frames.
             Try <a HREF="fillm1.htm">this</a></p>
       </body>
    </noframes>

</frameset>

<frameset>
     <noframes>
     </noframes>
</frameset>


</html>
 ============================================
navigate.htm

<html>
<head>
<script LANGUAGE="JavaScript">
<!-- Hide this from JavaScript non-enabled browsers

//Variables; setting the initial value of the current page

var FirstPage = 1;
var LastPage = 7;  // This 'book' has 7 pages
var CurrentPage = FirstPage;  

// displays page number PageNumber in main frame

function display(PageNumber) {
         var page = "" + PageNumber;
         page = "fillm" + page + ".htm";
         frames["mainframe"].location.href = page;
         CurrentPage = PageNumber;
}

// displays previous page (previous to the current page)

function goToPrevPage() {
         if ( CurrentPage != FirstPage)
                  CurrentPage--;
         display(CurrentPage);
}

// displays the next page (next to the current page)

function goToNextPage() {
         if ( CurrentPage != LastPage)
                  CurrentPage++;
         display(CurrentPage);
}

// displays the first page of your 'book'

function goToFirstPage()  {
      display(FirstPage);
}

// displays the last page of your 'book'

function goToLastPage()  {
      display(LastPage);
}

// display the top of the current page

function goToTopOfPage()   {
     display(CurrentPage);
}

// End of JavaScript -->
</script>

<title>Navigation bar</title>
<base target="mainframe">
</head>

<body>

<!-- go to first page button -->

<a href="#" onClick="goToFirstPage()">
<img src="first.gif" alt="go to first page" border="0"></a>

<!-- go to previous page button -->

<a href="#" onClick="goToPrevPage()">
<img src="previous.gif" alt="previous page" border="0"></a>

<!-- go to top of the page button -->

<a href="#" onClick="goToTopOfPage()">
<img src="top.gif" alt="go to top of this page" border="0"></a>

<!-- go to next page button -->

<a href="#" onClick="goToNextPage()">
<img src="next.gif" alt="go to next page" border="0"></a>

<!-- go to last page button -->

<a href="#" onClick="goToLastPage()">
<img src="last.gif" alt="go to last page" border="0"></a>

</body>
</html>
#2

مرحبا اخي بامكانك تغيير navigate.htm وجعله كالتالي forward and back

<html>
<head>
<title></title>
</head>
<body>
<form>
<input type="button" value="Back" onclick="history.back()">
<input type="button" value="Forward" onclick="history.forward()">
</form>
</body>
</html>

لست متواجد بشكل يومي

#3

أخي العزيز Student_1981

شكرا على الرد ولكن سؤالي يختلف تماما عن اجابتك

على العموم عرفت ان الخلل في الكود هو في هذا السطر:

   frames["mainframe"].location.href = page;

ولكني لم اعرف تصحيحه

وشكرا

#4

الأخوة الأعزاء

هل من الممكن ايجاد حل لتصحيح هذا السطر

  frames["mainframe"].location.href = page;

وشكرا

#5

الرجاء المساعدة

شكرا

#6

اخي

حاولت اعرف وين الخطا بس ما عرفت على الرابط تجد مساعدة للFrames لعلك تجد البديل اعذرني مشغول شوي واذا ماعرفت ان شاء بسويلك البديل بس بدك تصبر شوي

Frames in HTML

لست متواجد بشكل يومي

#7

شكرا لك أخي العزيز Student_1981

وفي انتظار البديل

#8

السلام عليكم اخي العزيز VB786

اسف على التاخير

انا الي فهمته ان الكتاب يتكون من fillm1...fillm7 وهذه الاكواد عن طريقها تستطيع اختيار اي صفحة لقرائتها

ماتقولي في اخطاء فحصته

index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Der universelle Titel</title>
</head>
<frameset cols="250,*">
  <frame src="navigate.htm" name="Navigation">
  <frame src="start.htm" name="Data">
  <noframes>
 your browser don't support frame !!
  </noframes>
</frameset>
</html>

*******************************************************
navigate.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Navigation</title>
</head>
<body bgcolor="#E0C0FF" text="#000000" link="#804080" vlink="#603060" alink="#804080">

<h1>Navigation</h1>
<p>
<a href="../fillm1.htm" target="Data"><b>Page 1</b></a><br>
<a href="../fillm2.htm" target="Data"><b>Page 2</b></a><br>
<a href="../fillm3.htm" target="Data"><b>Page 3</b></a><br>
<a href="../fillm4.htm" target="Data"><b>Page 4</b></a><br>
<a href="../fillm5.htm" target="Data"><b>Page 5</b></a><br>
<a href="../fillm6.htm" target="Data"><b>Page 6</b></a><br>
<a href="../fillm7.htm" target="Data"><b>Page 7</b></a><br>
</p>

</body>
</html>
*******************************************************
start.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Start</title>
</head>
<body bgcolor="#FFF0C0" text="#000000" link="#A00000" vlink="#600000" alink="#A00000">

<h1>Welcome</h1>
<p>please select</p>

</body>
</html>

لست متواجد بشكل يومي

#9

عشان تفحصه خزن الملفات index.html و start.htm و navigate.htm في Directory على Desktop والملفات fillm1.htm ... fillm7.htm على Desktop مش في Directory الي موجود فيindex.html و start.htm و navigate.htm

هيك بكون الشكل الاساسي لملفات fillm1.htm ... fillm7.htm

<html>
<head>
<title>
hallo</title>
</head>
<body>
هنا تستطيع ان تكتب المحتوى  
</body>
<html>

وان شاء الله هاي المرة اجابتي ما اختلفت عن سؤالك

لست متواجد بشكل يومي

#10

شكرا لك أخي العزيز Student_1981

ولكن لو تلاحظ سؤالي يختلف تماما عن جوابك فالمثال الذي كتبته أنت الراب فيه عادي.

وشكرا

هذا الموضوع مغلق.

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