By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,678 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,678 IT Pros & Developers. It's quick & easy.

OnClick IE Mobile

P: n/a
i'm using the Microsoft Device Emulator to test a web app that i'm
developing. The click event isn't fired for neither img or input
type=image tags, however in the Internet Explorer Mobile Reference
(http://msdn.microsoft.com/en-us/library/ms832933.aspx) it says that
input type=image supports onclick events. Does anyone know if there is
bug the emulator or if MSDN is wrong? Both of the options seem quite
odd, but the fact is that
<input type="image" onclick="alert('HELLO WORLD')" src="someimage.png"/
isn't fireing any alert.
Thanks, best regards

Carlos Pedro
Sep 15 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sister Ray wrote:
i'm using the Microsoft Device Emulator to test a web app that i'm
developing. The click event isn't fired for neither img or input
type=image tags, however in the Internet Explorer Mobile Reference
(http://msdn.microsoft.com/en-us/library/ms832933.aspx) it says that
input type=image supports onclick events. Does anyone know if there is
bug the emulator or if MSDN is wrong? Both of the options seem quite
odd, but the fact is that
<input type="image" onclick="alert('HELLO WORLD')" src="someimage.png"/
>isn't fireing any alert.
First of all, MSHTML does not support XHTML to date, so make this HTML and
lose the `/'. Second, validate your markup (e.g. an `alt' attribute is
missing here) and see if that helps. Third, post the URI of a test case so
that one can have a look at your real code; this is not a guessing game.

<http://jibbering.com/faq/>
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Sep 15 '08 #2

P: n/a
I want capture a click event on an image i do not need form for that,
in the page in question do not intend to submit any form to the
server.
<input type="image" ...is a *submit button*. *It is not supposed towork
without a `form' element, providing an `action' attribute, that contains it.
what i wanted to do was something quite trivial, as i said, i wanted
to have an image with a click event on my html page, but it seems, img
nor input type="image" tags support on click events on Pocket IE. My
perversion, seems to work in IE, Pocket IE, Mobile IE and Opera, how
big can my sin be, if I seem to have no alternative.
<a href="#" onclick="alert('')"><img src="some uri" alt="blah blah"
</ a>

This is not a submit button or an anchor but (the perversion of) a visible
hyperlink; it is supposed to work everywhere within the `body' element.
I need to have images, it should be an input type image, that as i
said does not work with Pocket IE, and my project must run on Pocket
IE, with the same look and feel has it does on other mobile browser,
at least as much as it is possible.
For a button that works everywhere within the `body' element, script support
provided, use

* <input type="button" ...>

or

* <button type="button" ...>...</button>

The latter should only be used if the caption needs to be more than plain
text and all target UAs have been tested positive (unlike the former, the
latter was not introduced before HTML 4.0).
Despite what may seem i know something of HTML, the fact is i need
images with a click event, not a button with text.

PS: the invalide html was generated by aptana studio, do you know a
better ide for javascript, html?
Sep 23 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.