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
vinayakk
Posts: 20
Registered: ‎12-27-2009
My Device: Not Specified

v4.5 - Change image using script!

I have a HTML page which has one button and one image. On click of the button I would like to hide this image and display a new image its place.

 

Since I am using v4.5 I cannot change the image dynamically using JavaScript...In this case what all options do I have to achieve the desired results. I would not like to design an altogather new HTML page just to show another image.

 

Thanks in advance for ur kind consideration!

 

As ever,
Vinayak Kadam
Please use plain text.
Developer
mikeo007
Posts: 28
Registered: ‎11-17-2009
My Device: 9900
My Carrier: ATT

Re: v4.5 - Change image using script!

Your only option other than javascript that I can think of would be to use an iframe, but I don't know if they are supported in 4.5 either.

Please use plain text.
New Developer
vinayakk
Posts: 20
Registered: ‎12-27-2009
My Device: Not Specified

Re: v4.5 - Change image using script!

[ Edited ]

Thanks for your reply.

 

I just checked, iframes are supported for v4.6 and above.

 

Need some other way to do so. Somebody please help!

 

As ever,
Vinayak Kadam
Please use plain text.
Developer
jwargo
Posts: 395
Registered: ‎12-18-2008
My Device: BlackBerry Torch 9800
My Carrier: AT&T

Re: v4.5 - Change image using script!

The JavaScript DOM in 4.5 is Read-Only. The content in the browser cannot be manipulated programatically. That's basically it. Not much that you can do.

Please use plain text.
New Developer
vinayakk
Posts: 20
Registered: ‎12-27-2009
My Device: Not Specified

Re: v4.5 - Change image using script!

[ Edited ]

Hey John,

 

Thanks a lot for your reply!

 

I have been really behind this since many days and after a lot of R&D and views of you people I think we should conclude that there is no way in v4.5 through which we can replace an image dynamically using JavaScript, neither there exists a workaround to do so!

 

Only option left available for me is to create a new page which will have the changed image and display that page!

 

Its absolutely unfortunate for somebody to work on browsers for Blackberry devices and your client asks you to target v4.5 devices :smileysad:

 

As ever,
Vinayak Kadam
Please use plain text.