Note that there are some explanatory texts on larger screens.

plurals
  1. POpreventDefault not working when ismap is added to the image link in firefox
    primarykey
    data
    text
    <p>I'm working on a test in creating a map editor, when clicked on an image, it will show the result of the clicked point</p> <p>I don't want to reload the page so I used preventDefault() when the user clicks on the map..</p> <p>I tried this in chrome and it works fine, but on firefox, it is just reloading..</p> <p>I also tried removing the <code>ismap</code> attribute in the image and the <code>preventDefault()</code> worked. But still, I want the <code>ismap</code> attribute to be included in the <code>img</code> tag</p> <p>I searched for similar problems, tried to solve it based on their suggestions and came up to these code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="jquery-2.0.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $('#test').bind('click', function(e){ e.preventDefault(); //some more codes here.. $('#output').append('success'); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="preventDefault.html" id="test"&gt;&lt;img src="aup.jpg" ismap="ismap"/&gt; &lt;/a&gt; &lt;div id="output"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>the file name is <code>preventDefault.html</code></p> <p>still, the code works on chrome but negative on firefox what I want is, if i clicked on the image, 'success' should append to <code>#output</code></p> <p>I'm working on Firefox 26.0 and Chrome 31.0.1650.63</p> <p>[ADDITION]</p> <p>Well, what I want to create later is a map editor, where if the user clicks on ANY area of the image, it will return the coordinates and later will be saved to a certain file.. this is a tutorial I'm following: <a href="http://www.tuxradar.com/practicalphp/11/2/5" rel="nofollow">complex shapes</a>. Well, I want the link not to reload.. However, it is different from the suggested duplicate link</p> <pre><code>&lt;map&gt; &lt;area&gt; &lt;/map&gt; </code></pre> <p>tags since the <code>&lt;map&gt;</code> tag already have fixed coordinates linked to the image..hope I cleared the misunderstanding.. :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload