the GetResultForPage function will be defined on the window object, not the document. I'm not sure if that js_eval will work, though, as I'm not sure how you refer to the window in firewatir.
I recommend Vapir-Firefox, an updated fork of Firewatir. it will fire the correct javascript events when you call #click. if there is any issue with that, you can call the function directly using something like: browser.content_window_object.GetResultForPage('2') Check Vapir's page at http://vapir.org/ and the wiki at http://wiki.github.com/vapir/vapir/ On Mon, Jul 19, 2010 at 23:53, Bruno Wüest <wue...@ipz.uzh.ch> wrote: > I have some basic experience with watir, but struggle to get a > javascript function called. More specifically, I try to get firewatir > execute a javascript function which is embedded in a table cell. This > cell contains a function to get a table with new results from a > database query. It looks like this: > > <td class="gotoPageCell" onclick="GetResultForPage('2');">next</td> > > The function GetResultForPage('page') is located in an external > javascript named "GetResults1.js" which is linked in the header of the > respective page. I tried to directly execute the function with: > > browser.js_eval("document.GetResultForPage('2');") > > This, however, left me with the error "JsshSocket::JSTypeError: > document.GetResultForPage is not a function". > > I also tried to get to the table cell by its index and execute the > function with ".click" or ".fire_event('onclick')". > > Does 'firewatir' support the call of such external javascript > functions? I appreciate any idea. > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > To unsubscribe: > watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com