Good lord! Now **that's** a fine hair to split. Larry, you're a genius. It's fixed. Brilliant. Thank you for taking the time to explain that so thoroughly.
So there are probably different ways to set up the test: test the array exists (which is what Mike's code is doing, unbeknownst to me), or maybe test to see if the array has a value? Wow, you really know your stuff. Thank you, thank you! On Feb 7, 1:31 am, "[email protected]" <[email protected]> wrote: > On Feb 6, 9:51 pm, BuckyE <[email protected]> wrote: > > > Thank you guys for trying to puzzle this out. > > > Larry, I thought I was doing just what you say. > > > First, I set up the queries to use the argument passedmarkerid just so > > I could keep that value separate from markerid, which of course does > > exist in the idmarkers array. Second, I thought that the If Statement > > "if (passedmarkerid)..." WAS testing for the existence of data in the > > passedmarkerid variable. So that if when the onload was invoked, > > passedmarkerid had no data in it, then the whole If Statement would > > just not get run. > > The variable passedmarkerid is initialized to an empty array. An > empty array is not null (it is an object), there for it always passes > the test > "if (passedmarkerid)". Do this: > var passedmarkerid; > instead of: > var passedmarkerid = []; > it will work as you want. > > > > > I have declared "var passedmarkerid = [];" globally, right at the > > beginning of the script. I assumed that in the case the page gets > > loaded without a passedmarkerid argument in the URL, passedmarkerid > > would be blank, would not exist, or whatever. > > No. It is what you initialized it to; an empty array (which is not the > same as "blank, would not exist or whatever..." > > -- Larry > > > GEvent.trigger(idmarkers > > [passedmarkerid],"click") wouldn't get a chance to happen. Isn't that > > what my code means? Maybe I'm missing something basic here. Obviously > > > Ralph, thanks for your kind words. You've saved me from disaster here. > > But sadly, I can't just test for "query." In some cases, a "category > > query" will exist without a "passedmarkerid query." In some cases, a > > category AND a passedmarkerid query will both exist. There's never a > > case of having ONLY a passedmarkerid query. That's just the way the > > other pages are set up. So, unless I'm misunderstanding all this, I > > can't simply test for a query. Blah. > > > Maybe there's some more rigorous way to test for a passedmarkerid > > query than simply saying "if (passedmarkerid)"? > > > Or is some little bit of my code putting a value in passedmarkerid > > without my knowing it? The alert always cites id 12, the last marker. > > Is that a clue I'm too tired to understand? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
