Note that there are some explanatory texts on larger screens.

plurals
  1. POReturned data not showing in source code, How do I select Ajax Loaded Data?
    primarykey
    data
    text
    <p>I am making a Category Tree Selection for eBay Categories.<br> I have a select box... </p> <pre><code>&lt;div id="div_firstCat"&gt; &lt;select id="slct_firstCat" name="slct_firstCat" size="33"&gt; &lt;option value="353"&gt;Antiques&lt;/option&gt; &lt;option value="550"&gt;Art&lt;/option&gt; ... and so on.. &lt;/select&gt; &lt;/div&gt; &lt;div id="div_secondCat"&gt;&lt;/div&gt; </code></pre> <p>I am using the following JQuery function to post data to my PHP application, which will return another Select box depending on which first category is selected (above).</p> <pre><code>// First Level Categories $("#slct_firstCat").change(function(){ // On change of slct_firstCat var actionRequested = "AJAX_getCats"; // My personal PHP Identifer var url = "index.php"; // Post to index.php var catId = $("#slct_firstCat").val(); // Get the CatID from the select box. // Post this data to PHP and return the data into #div_secondCat $.post(url, {AJAX_Action: actionRequested, categoryId: catId, categoryLevel: 1}, function(data){ $("#div_secondCat").html(data); }); // End of Function getCats }); </code></pre> <p>The PHP File returns this select box, identical to above but different name.</p> <pre><code>&lt;select id="slct_secondCat" name="slct_secondCat" size="33"&gt; &lt;option value="353"&gt;Sub-Cat of Antiques&lt;/option&gt; &lt;option value="550"&gt;Sub-Cat of Antiques&lt;/option&gt; and so on.. &lt;/select&gt; </code></pre> <p>Now when I try to get a option value via JQuery from "slct_secondCat" (The select loaded via AJAX), It doesnt get the option value, so I cant navigate further down the cat tree.</p> <p>This is the JQuery Function for the second category post.</p> <pre><code>// Second Level Categories $("#slct_secondCat").change(function(){ var actionRequested = "AJAX_getCats"; var url = "index.php"; var catId = $("#slct_secondCat").val(); $.post(url, {AJAX_Action: actionRequested, categoryId: catId, categoryLevel: 2}, function(data){ $("#div_thirdCat").html(data); }); // End of Function getCats }); </code></pre> <p>When I look in the source code of the page, after the AJAX loaded data, The div_secondCat doesnt display anything inside the source code, Even though the div has data loaded into it, the JQuery returned data from the post into the div and didnt update the source code of the page.</p> <p>So Basically, I get categories from my PHP file via eBay web service, I want to navigate to the final category I want and be able to select it via JQuery.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload