Hi, Try this:
ff.js_eval("var win_all = getWindows(); var target_win = win_all[0]; target_win.content.my_js_func()") where -- ff is the FireWatir::Firefox instance -- There are no other FF instances open. If you have, use the appropriate window index at win_all[index], index starts at 0. -- my_js_func() is your custom Javascript function. I guess there may be a niftier way to identify the target window rather than by array index. Basically target_win is an instance of ChromeWindow. Using the XUL API, there might be a way to perform this identification. Hope this helps. On Sep 6, 12:01 pm, Tony <[EMAIL PROTECTED]> wrote: > Hi Aidy, > > >Why have you put the backslashes in the above call? > > iam just escaping the double quotes ... hence the backslash > > >And also, do you > > know why we do not need to specify the script language in the second > parameter? > Not sure abt this ... but looks like the default language is > javascript. > > Were you able to do something like this using $jssh_socket.send()? ... > iam seeing a lot of code just to do a goto in firewatir. > Looks like one would have to first get the current instance of the > window, then do the call. > > js_eval is throwing an error when i try to use alert. > Something like exec_script will be very useful, i have been using it > get the style attributes of a particular element after some action. > Quite useful to check javascript functionality on a page. > > -Tony --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---