语言

Menu
Sites
Language
Tizen Web App - Events are not getting fired

Hi 

I have created project using the Tizen Web UI Framework Applicaiton (Navigation Template).

Now when i redirect between nav1(Onclick displays the page1.html) to nav2(Onclick displays the page2.html)the events are not firing in page2.html when i transition from page1.html.

Events like onload(), document ready  and click events of button is also not firing. 

Please can anyone help me in this regard.

Warm Regards

Mohammed Irfan 

 

Index.html

    <div data-role="footer" data-id="foo1">

            <div data-role="controlgroup" data-type="horizontal">
                             
                <a data-role="button" href="index.html">
                   <img src="images/age.png" width="36px" height="36px"/>
                </a>
                <a data-role="button" href="cardilogy.html">
                    <img src="images/cardiology.png" width="36px" height="36px"/>
                </a>
                               
            </div><!-- /navbar -->
    </div><!-- /footer -->   
 
 
Home.html
 
    <script type="text/javascript">    
  function test()
  {
alert(222);
  }    
    </script>
 
    <div data-role="content">
            <ul data-role="listview">
                <li><a data-role="button" href="#ldl" onclick="test();" >LDL Calculated</a></li> # Not working - onlick is not working nor the href
                <li><a class="ui-li-text-main" href="#map">Mean Arterial Pressure (MAP)</a></li>
                <li><a class="ui-li-text-main" href="#timiriskindex">TIMI Risk Index</a></li>                
            </ul>
    </div><!-- /content -->
 
Once i redirect from index.html to home.html, neither the href link works nor the onclick works in home.html page.
 

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

8 回复
konduri sai swathi
Hi, kindly share the code snippet of what you are working on for better understanding of the issue
Mohammed Irfan Shirur
Index.html Page Home.html Page
Once i redirect from index.html to home.html, neither the href link works nor the onclick works in home.html page.
  • LDL Calculated
  • Mohammed Irfan Shirur
    Thanks for your reply. I have updated the code in the main thread.
    konduri sai swathi
    Hi, The script tag where you defined the test() should be added in the index.html but not in home.html , onclick works if you do so . Try it once
    konduri sai swathi
    For href, add the code in the index.html. for example if you want to navigate to "page2" from home.html using href="#page2", then add the "page2" code in index.html but not in home.html
    Mohammed Irfan Shirur
    Ok Fine. I will try this approach. In Tizen when i redirect from one html page to other the onload nothing fires. is that because the Tizen adds the html page as content to index.html ?
    Kevin
    Hi, As you may already be aware, the Tizen Web UI Framework is built on top of jQuery Mobile. You may find it easier to structure you application using the a single html page and multiple div elements that act as pages using the data-role="page" attribute/value. You can then define your JavaScript for each "page" by delegating events like this;
    <div data-role="page" id="index"> <!-- page markup --></div>
    <div data-role="page" id="cardiology"> <!-- page markup --></div>
    
    
    
    You can then link to each page using the hash tag e.g. #index or #cardiology. For more info on pages, see here: http://view.jquerymobile.com/1.3.2/dist/demos/widgets/pages/
    Mohammed Irfan Shirur
    Hey, Thanks a lot that was very useful info. Warm Regards Mohammed Irfan