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. :)
I'd assume evt is the same sort of thing. 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.
Don't know if that info helps what you're trying to do, but it seems to at least be the ugly truth. :)
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.
-C
On Tue, Apr 25, 2017 at 10:06 AM, Steve Litt <slitt@...2357...> wrote:
Thanks C R.
I've posted it at http://troubleshooters.com/codecorn/clickmap/hello1.htm, which is a working but very rudimentary clickable map.
Each circle has an onclick, onmouseover, and onmouseout event, all three of which, each of which calls a javascript function in the
<html><head> (via the top. construct, which apparently is used within the <svg> to reach out to the containing <html>.
Anyway, each of those functions in the events for the circles uses an argument called "evt". If you change "evt" to "event" it works identically. But if you change it to almost anything else, the web page fails, and if you look at it in Chromium's debugging environment, your clicks produce "ev is not defined" if you'd used "ev" as that argument.
SteveT
On Tue, 25 Apr 2017 09:01:28 +0100 C R <cajhne@...155...> wrote:
Can you post your svg? It seems to me if evt were a reserved word it would fail, not succeed. :)
Most references I found indicate you can pass anything as an event storage variable, and i doubt "e" is a reserved word. If you could post a link to your html+svg file, we can probably advise better.
-C
On Tue, Apr 25, 2017 at 2:34 AM, Steve Litt <slitt@...2357...> wrote:
Hi all,
Within a <svg> element in my HTML body, I can use onclick(evt), as exemplified below:
============================================================
<svg width="500px" viewBox="0 15 80 30"> <circle id=circ1 r="6" cx="10" cy="30" onclick="top.doit(evt)" /> </svg> ============================================================
I can change the "evt" to "event" and it still works, but if I change it to anything else, for example "e", it fails. Is evt some kind of reserved word within SVG?
By the way, if an item in HTML itself (like a paragraph) has an onclick, you need to remove the "top." and only "event" will work.
I have the rudiments of a clickable map using SVG, CSS and Javascript, and am starting to build it into something useful.
Thanks,
SteveT
Steve Litt April 2017 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user