views:

29

answers:

0

I'm trying to make a wrapper around last.fm and need to invoke some of the javascript functions in the page. Particularly the ones for Stop, Skip, Ban and Love.

InvokeScript seems to work fine with any script function that is within the page HTML itself, but not with scripts loaded from external script files.

For example, the actual call to the skip function is LFM.Flash.Player.skip(), so I tried the following:

_browser.Document.InvokeScript("LFM.Flash.Player.skip");

But all it does is return null and nothing happens on the page.

I've confirmed that that call at least works as typed using the Chrome inspector and the console. (Haven't figured out if there is a way to invoke arbitrary javascript in IE... any suggestions are appreciated)

Is there some special way that that function must be invoked?

Also, yes, I have tried it with and without the parentheses in the script call... still no luck.

Edit: To be clear, I am doing this in the WinForms Browser Control not in an ASP.NET page.