I'm just not getting it. My web pages are generally generated
dynamically. To get specific, I'm using jQuery/Ajax to make a category
selector widget, just like the one you use on eBay to sell stuff.
Here's what it looks like in a basic, test environment: 
http://www.shmax.com/pick_cat

So far so good.

Here's what gets called when the document finishes loading:

$(document).ready(function(){
   AttachCatPicker();

   $("#appendMe").load( "/include/record_selector.php",  { cat_id: 1,
action: "choose_cat" }, AttachCatPicker );
 });

Also well and good. The page loads, the <div> with id "appendMe" is
found, my server side php is invoked, outputs the html for the select
widgets, and everything is fine.

The problem is that the "load" seems to get called whether "appendMe"
is found or not. In other words, even pages that don't have the
"appendMe" div on it are calling "load", invoking my php code for
populating the select boxes, and so on. What the heck is going on? I
thought that doing $("appendMe").load is saying "find me all nodes in
the DOM with an id of 'appendMe', and for each one fill it with the
contents generated by record_selector.php".

Do I have that totally wrong, or what?

Thanks much!

- shmax

Reply via email to