Cool, I'll send you an working example. kl. 05:23:25 UTC+2 søndag 21. juli 2013 skrev Peter Bienstman følgende: > > OK, I understand better what you mean now. I'll have a go at implementing > the second workaround after my holidays. > > Peter > > Gnome <[email protected] <javascript:>> wrote: >> >> It was src. SRC does not work even in firefox. >> >> kl. 11:22:23 UTC+2 lørdag 20. juli 2013 skrev Peter Bienstman følgende: >>> >>> Does src instead of SRC work? >>> >>> Peter >>> >>> Quoting Gnome <[email protected]>: >>> >>> > I decided to do another try of creating an map-overlay script in >>> javaScript >>> > for replacing the current I'm using, witch is made in flash. >>> > >>> > When reffering to an image in my script, I need to use an absolute >>> path for >>> > it to work. >>> > >>> > For example the html in the card looks like this: >>> > >>> > <div id="root"></div> >>> > <SCRIPT LANGUAGE="JavaScript">var x = 268;var y = 400;var i = >>> > 'basal-ganglia.jpg';</SCRIPT> >>> > <SCRIPT LANGUAGE="JavaScript" SRC="imageHelper_files/d9.js"></SCRIPT> >>> > <SCRIPT LANGUAGE="JavaScript" >>> SRC="imageHelper_files/placeDot.js"></SCRIPT> >>> > >>> > The variable i declares the path to the map. For it to work, the path >>> needs >>> > to be absolute like this: >>> > >>> > var i = >>> > >>> 'file:///C:/Users/User/AppData/Roaming/Mnemosyne/default.db_media/basal-ganglia.jpg'; >>> >>> >>> > >>> > In the script linked (placeDot.js), the image is inserted into the >>> document >>> > like this: >>> > >>> > var map = document.createElement('IMG'); >>> > map.src = i; >>> > root.appendChild(map); >>> > >>> > I could link the image file in the card html, but that would not be >>> ideal >>> > because it would require more code in the card and it would be harder >>> to >>> > make changes later. Normally the absolute path can be found using >>> window. >>> > location.pathname+window.location.search. But this only returns >>> "blank" in >>> > mnemosyne. >>> > I wonder if a workaround could be made where the absolute path is >>> declared >>> > in the html template by mnemosyne, for example: >>> > >>> > <SCRIPT LANGUAGE="JavaScript">var db_media = full path to db_media >>> goes >>> > here;</SCRIPT> >>> > >>> > Then later accesed by the users script. >>> > Or that mnemosyne replaces text containing a certain codename in the >>> html, >>> > for example: >>> > >>> > var i = 'db_media:///basal-ganglia.jpg'; >>> > >>> > It would be nice if there could be a workaround for this. >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> > Groups "mnemosyne-proj-users" group. >>> > To unsubscribe from this group and stop receiving emails from it, >>> > send an email to [email protected]. >>> > To post to this group, send email to [email protected]. >>> > To view this discussion on the web visit >>> > >>> https://groups.google.com/d/msgid/mnemosyne-proj-users/662a72f9-63f5-4e8a-bb2c-a245422acd8e%40googlegroups.com. >>> >>> >>> > For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >>>
-- You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/b4a6a987-9b34-4f9e-838c-028df14b0398%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
