On Tue, 25 Apr 2017 13:50:38 +0100 C R <cajhne@...155...> wrote:
Okay, so no amount of dicking around with replacing variables, reconstructiong even objects, etc was working. Then I stumbles upon this for why "event" must be "event" for in-line variables: http://stackoverflow.com/questions/11265869/how-does-javascript-recogize-eve...
Far from a satisfying situation. :)
Good. I'm not crazy.
I'd assume evt is the same sort of thing.
Yes. It sounds to me like there are objects called "event" and "evt" in the namespace native to some or all of the DOM objects, and those objects are your only choice for the first arg to onclick etc.
The real problem is your script will not work at all as is in IE, which apparently uses a global event object (window.event). So if you want to support IE, you'll have to check for the presence of window.event, then assign the object to evt or event to pass it through your functions.
Thanks. That's a pretty clean solution. In a later email alvinpinner said my map appears to work in the IE browser in Win10, so I might not need to do that, but if I do, it should be easy enough.
Don't know if that info helps what you're trying to do, but it seems to at least be the ugly truth. :)
Most software has some ugly truths, and if it's basically good, I just say "OK, I'll play your silly game" and often also document it on Troubleshooters.Com. My main concern was that perhaps I was missing something. Apparently I'm not.
I guess it could be worse. You could be required to construct a global event handler from scratch. Anyway, do let me know if you find something more useful. Now I'm curious about alternative event handler code.
Now that I know this is a known situation, I'm just going to use evt or event and go on to the next challenge. Things get trickier when you try to have the <svg> element imported with an <img> or <object> node. And then there's the fact that if you build the <svg> with Inkscape, you need to be very careful about certain things, especially you need to have the origin of your drawing be 0,0, especially if you intend to "crop" your file (from A4 or Letter or whatever).
AND, I need to see how far I can go inside Inkscape with this stuff. I already know that using Object Properties Shift+Ctrl+O I can change the ID and label of the object, and using the Interactivity dropdown on the Object Properties screen I can, at least to some degree, set the various event handlers. Perhaps I can go deeper still.
Thanks,
SteveT
Steve Litt April 2017 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques