النتائج 1 إلى 2 من 2

الموضوع: طلب مساعدة في AJAX TAB CONTENT

  1. #1

    طلب مساعدة في AJAX TAB CONTENT



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

    أريد عمل (Ajax Tab content) يجلب البيانات من الداتا بيز
    عندي جدولين
    الجدول الاول (sections) و يحتوي على ورقم و اسم القسم (secid , secname)
    الجدول الثاني (articales) و يحتوي على (artid, artsecid ,title, article)

    المطلوب جلب اسماء الأقسام للـ (Ajax tab content)
    وعند الضغط على كل اسم يظهر لي عناوين المقالات الخاصة بالقسم
    اللي سويته أنا:
    كود PHP:
    <script type="text/javascript">
        function startLoading() {
          Element.show('mainAreaLoading');
          Element.hide('mainAreaInternal');
        }
        function finishLoading() {
          Element.show('mainAreaInternal');
          setTimeout("Effect.toggle('mainAreaLoading');", 1000);
        }

        function loadContent(id) {
          startLoading();
          new Ajax.Updater('mainAreaInternal', 'contentajax.php', {method: 'post', postBody:'content='+ id +''});
          finishLoading();
        }
    </script>

    <!-- CSS -->
    <style>
    .mainAreaInternal {
        position: absolute;
        width: 500px;
        height: 300px;
        background-color: #cccccc;
        overflow: auto;
        padding: 2px;
    }

    .mainAreaLoading {
        position: absolute;
        width: 500px;
        height: 300px;
        background-color: #999999;
    }
    </style>

    <div>
    <?php
    $getAJAX 
    mysql_query("SELECT * FROM sections order by secid");
    if(
    mysql_num_rows($getAJAX)!=0){
    while(
    $g mysql_fetch_array($getAJAX)){
    echo
    "<span style='cursor: pointer' onclick='loadContent($g[secid])'>$g[secname]</span>";
    }
    }
    ?>

    <!-- Navigation End -->
    <p id="mainArea">
    <p id="mainAreaInternal" class="mainAreaInternal">


    <!-- End Main Area Internal -->
    <p id="mainAreaLoading" class="mainAreaLoading" style="display: none">

    <span style="position: relative; top: 100px; left: 100px">
    <img src="images/ajaxLoad.gif" align="center">
    Loading Please Wait...
    </span>

    </div>
    وفي صفحة contentajax.php كتبت:

    كود PHP:
    <?php
    $content 
    $_POST[content];

    $Query mysql_query("SELECT * FROM articles WHERE artsecid='$content' order by artid LIMIT 10");
    WHILE(
    $s mysql_fetch_array($Query)){
        echo
    "$s[title]<br>";
    }
    ?>
    ملاحظة الكود معتمد على مكتبة (jQuery) أنا استدعيتها في الهيدر
    بس مش عارف وين الخلل بالضبط يا ريت تساعدوني فيه







  2. #2


    إيش ما في أحد يقدر يساعدني ؟؟؟؟
    والله محتاج الكود ضروري










ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

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