views:

24

answers:

1

In my webpage, I am using ajax + RoR to refresh the contents of the textbox using searchtool. All the value i am accessing, such like superset value for the current page. Means for example there is headquater and it has many stations. When I am trying to access the value of headquater at station then corresponding values changes at textbox.

Here, we are displaying the global value of head-quarter, due to less space I am showing telephone number and its quality on Tool-Tip. When page changes the value of station then whole contents changes but the tooltip remains same. Sample of code ::

    <div class="divFloat" id="populate_phone1" onmouseout="UnTip()" 
onmouseover='Tip("<%=GlobalPartnersHq.globally_phone_type(@station_hq.is_global_phone1, @station_hq.phone1_type_id) %>")' > 
<%=GlobalPartnersHq.global_phone(@station_hq.is_global_phone1, @station_hq.phone1)%>
                </div>

Please, help me out to refresh the javascript onmouseover value when ajax updates the value of textboxes.

A: 

I'm not following your code entirely, but it sounds like Ajax is updating the DOM and you want to trigger some additional code. What I recommend is that you emit a custom event and write separate handlers. If you are using jQuery check out trigger docs. You can do something like $.trigger('myEvent') then bind multiple handlers to it (e.g. $('selector').bind('myEvent', function() {});) to update various parts of the page.

Andy Atkinson