3 Replies Latest reply on Jul 25, 2013 1:40 PM by Alexey Tikhvinsky

    Integrate Javascript to my Rhodes App

      Hello,

       

      i want to integrate this example http://jsfiddle.net/ZPYUS/ to my Rhodes App.

      Up to now I have not once used Javascript, so 1. I don´t know which  files I need, 2. I don´t know what I have to write in my controller and  3. I don´t know what I have to do in my view.

      Please explain it to me step by step

       

      I try to write the function in the application.js

      $("#changePanel").click(function() {

          var data = "foobar";

          $("#panel").hide().html(data).fadeIn('fast');

      });

       

      then I change my layout erb. at the following content

      <% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' || System::get_property('platform') == 'WP7' || is_bb6 || System::get_property('webview_framework') =~ /^WEBKIT/ %>

            <script src="/public/js/application.js" type="text/javascript"></script>

              <script src="/public/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>

              <script src="/public/jquery/jquery.json-2.3.min.js" type="text/javascript"></script>

       

      and in my view i added

      <div data-role="page">

       

          <div data-role="header" data-position="inline">

          <h1>Model001s</h1>

          <a href="<%= Rho::RhoConfig.start_path %>" class="ui-btn-left" data-icon="home" data-direction="reverse" <%= "data-ajax='false'" if is_bb6 %>>

            Home

          </a>

          <a href="<%= url_for :action => :new %>" class="ui-btn-right" data-icon="plus">

            New

          </a>

          </div>

       

            <div id="panel">test data</div>

            <input id="incre" value="Change Panel" type="button">  </div>

      </div>

       

      I don´t know whats wrong.

       

      Please help me