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
Highlighted
Contributor
Posts: 17
Registered: ‎04-09-2012
My Device: BB9900
My Carrier: 02

JS onclick event load innerHTML not working

Hello guys,

 

I am new to BB Dev and just would like to know why my onclick does not work. I have read some previous posts about the 4.5 browser not supporting some features. My App works like this, I only have one html file and use JS to dynamically load the content into it using innerHTML. My question is this, if some browsers do not support this, then what is the alternative? I presume having different html files but Ripple will not access them, saying 404 not found, how do i make Ripple access files other than index.html. I know JS works because it is enabled and alert box works. Just the innerHTML. Thanks in advance.

Developer
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: JS onclick event load innerHTML not working

innerHTML does work. I use it on all my apps..

 

Make sure the syntax is as follows:

    document.body.innerHTML="put html code here"; 

 

not if u need to put quotes inside the two quotes u need to put a backwards slash like \" to make the quote work.

 

Also another way to write is

    document.body.innerHTML="";   //clears page

  document.write("html code goes here");  //starts writing html code


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!