Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 11
Registered: ‎10-24-2008
My Device: Not Specified

Image links dont work in browser or BrowserField

Hi

 

It seems that the image links dont work in the browser or the browser field when clicked.

 

On normal links, when i click them with the trackball  i get an option through the popup "Get link", which i select and get navigated to the page.

 

This is not happening whenever the <img> tag contain an <a href>.

 

Do i have to enable image links just like i enable the javascrip?

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Image links dont work in browser or BrowserField

This should work.  Can you provide a URL to a sample page?  What BlackBerry model and handheld software version are you testing on?  You can find this under Options, About on the BlackBerry.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Image links dont work in browser or BrowserField

in the HTML 4.01 specification, the IMG element cannot contain any child element.
if you want a clickable image, you have to insert the IMG element in a A element.

 

 

< A href="lala.html" > < img src="http://myserver.com/myimage.png" alt="this image" > </ A >

 

 the relevant paragraph is :

http://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG

 




The search box on top-right of this page is your true friend, and the public Knowledge Base too:
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Image links dont work in browser or BrowserField

Xandrex is correct, sorry I missed the reversed order of the tags.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 11
Registered: ‎10-24-2008
My Device: Not Specified

Re: Image links dont work in browser or BrowserField

Hi,

 

Thanks for your input. 

 

Here is the link to the html page im testing... http://amobeta.addictivemobility.com/files/105/

 

The tags are in the reverse order (see below) but contained inside a <div> and <li>. The image links work fine on the internet explorer. 

The source contains :

 

<div class="header">
  <div class="logo"></div>
  <ul id="mainNav">
   <li id="updates"><img src="images/nav_updates_on.png" alt="" width="47" height="31" /></li>
   <li id="gallery"> <a href="gallery.php">  <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>
   <li id="camera"> <a href="camera.php">  <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>
   <li id="guestbook"> <a href="guestbook.php">  <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>
   <li id="friends">  <a href="friends.php">  <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>
  </ul>
 </div>

 

 

Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Image links dont work in browser or BrowserField

hello,

overall HTML code is medium (not perfect because the alt attibute for images is missing).
I can click on the links in Firefox.
I can click on the links in the blackberry browser.

but on server side there is a major flaw.
the URL is not correct.
on a desktop browser, the link for example is :

<li id="gallery"> <a href="gallery.php"> <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>

 

on the blackberry browser the link is :

<li id="gallery"> <a href="gallery.html"> <img src="images/pixel.png" width="100%" height="31" border="0" /></a></li>

 

and of course, the gallery.html file does not exist. Just fix that and it should be okay.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
New Developer
Posts: 4
Registered: ‎02-16-2009
My Device: Not Specified

Re: Image links dont work in browser or BrowserField

Hi,

 

I have noticed that the "alt" function in the "<img>" does not work on the browser. Does anyone know how i can get an image to show the alt text in the html?

Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Image links dont work in browser or BrowserField


Zaid wrote:

Hi,

 

I have noticed that the "alt" function in the "<img>" does not work on the browser. Does anyone know how i can get an image to show the alt text in the html?


what do you expect from that property? It should appear only when the image cannot be displayed.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
New Developer
Posts: 4
Registered: ‎02-16-2009
My Device: Not Specified

Re: Image links dont work in browser or BrowserField

Hi,

 

On normal browsers the alt tag is displayed (like a tool tip) when the image is moused over.

 

I am trying to create a tooltip function on linked images such that when moused over or highlighted a text tip is shown. do you know of a way to do this with HTML/CSS ?

Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Image links dont work in browser or BrowserField


Zaid wrote:

Hi,

 

On normal browsers the alt tag is displayed (like a tool tip) when the image is moused over.


That happens, but only on browsers that do not respect the HTML 4.01 Strict recommendation (mainly Internet Explorer)

here is an explanation :
https://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ#Why_doesn.e2.80.99t_Mozilla_display_my_al...

alt is for replacing an image by a text.
title is for adding a tooltip when hovering on an element (especially an image).

alt : http://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt
title : http://www.w3.org/TR/REC-html40/struct/global.html#adef-title



The search box on top-right of this page is your true friend, and the public Knowledge Base too: