2011-07-20 73 views
0

嗨我不斷收到此錯誤在螢火蟲腳本「沒有元素找到」即使添加「標題('Content-Type:text/plain');」。誰能幫忙?謝謝。沒有元素在螢火蟲發現錯誤php ajax

categories.php

<?php 
    if(isset($_GET['1'])) { 
    header('Content-Type: text/plain'); 
     echo <<<HERE_DOC 
    <option value="1.1">Antiquities &gt;</option> 
    <option value="1.2">Architectural &amp; Garden &gt;</option> 
    <option value="1.3">Asian Antiques &gt;</option> 
    <option value="1.4">Books &amp; Manuscripts &gt;</option> 
    <option value="1.5">Decorative Arts &gt;</option> 
    <option value="1.6">Ethnographic &gt;</option> 
    <option value="1.7">Furniture &gt;</option> 
    <option value="1.8">Home &amp; Hearth &gt;</option> 
    <option value="1.9">Linens &amp; Textiles (Pre-1930) &gt;</option> 
    <option value="1.10">Maps, Atlases &amp; Globes &gt;</option> 
    <option value="1.11">Maritime &gt;</option> 
    <option value="1.12">Mercantile, Trades &amp; Factories &gt;</option> 
    <option value="1.13">Musical Instruments (Pre-1930) &gt;</option> 
    <option value="1.14">Periods &amp; Styles &gt;</option> 
    <option value="1.15">Primitives;</option> 
    <option value="1.16">Restoration &amp; Care &gt;</option> 
    <option value="1.17">Rugs &amp; Carpets &gt;</option> 
    <option value="1.18">Science &amp; Medicine (Pre-1930) &gt;</option> 
    <option value="1.19">Sewing (Pre-1930) &gt;</option> 
    <option value="1.20">Silver &gt;</option> 
    <option value="1.21">Reproduction Antiques</option> 
    <option value="1.22">Other</option> 
    HERE_DOC; 
    } 

    if(isset($_GET['2'])) { 
    header('Content-Type: text/plain'); 
     echo <<<HERE_DOC 
    <option value="60435">Direct from the Artist &gt;</option> 
    <option value="158658">Art from Dealers &amp; Resellers &gt;</option> 
    <option value="52524">Wholesale Lots &gt;</option> 
    HERE_DOC; 
    } 

    if(isset($_GET['3'])) { 
    header('Content-Type: text/plain'); 
     echo <<<HERE_DOC 
    <option value="60435">Direct from the Artist &gt;</option> 
    <option value="158658">Art from Dealers &amp; Resellers &gt;</option> 
    <option value="52524">Wholesale Lots &gt;</option> 
    HERE_DOC; 
    } 

post_categories.html

+0

Your us ername非常合適。 :P – alex

+0

嘗試將'cat1.options [selectedIndex] .value'更改爲'this.value' –

回答

0

這裏是我的建議:

<?php if(isset($_GET['1'])): ?> 
<option value="1.1">Antiquities &gt;</option> 
<option value="1.2">Architectural &amp; Garden &gt;</option> 
<option value="1.3">Asian Antiques &gt;</option> 
.... 
<?php elseif (isset($_GET['2'])): ?> 
<option value="1.1">Antiquities &gt;</option> 
<option value="1.1">Antiquities &gt;</option> 
.... 

<?php endif;?> 

這樣,你的代碼更有條理,沒有機會少的錯誤