0

Well based on the post: The same as this one

I've tryed to do this:

Call mFramePesquisa.parentWindow.execScript("gotoPage(pesquisa.html?re_ligacao)", "JavaScript")

As you can see the js function takes one parameter "pesquisa.html?re_licagao" but when executed on the browser it gives an error saying that ":" was expected.

So i've tryed to quote the function parameter without success:

Call mFramePesquisa.parentWindow.execScript("gotoPage(" & chr(34) & "pesquisa.html?re_ligacao" & chr(34) & ")", "JavaScript")

or

Call mFramePesquisa.parentWindow.execScript("gotoPage('pesquisa.html?re_ligacao')", "JavaScript")

Both throw out an "Object expected" error on ie browser.

Any suggestions?

thx

PS: I've tried also to use chr(63) instead of "?" but without success.

Edit: I suspect it had something to do with the string used as parameter, since in the original JS the function is called like this on a onChange evento for a object:

onchange=javascript:gotoPage(this.value)
Community
  • 1
  • 1
Paulo Bueno
  • 2,499
  • 6
  • 42
  • 68
  • `gotoPage('pesquisa.html?re_ligacao')` should work fine, but requires a function called `gotoPage` to be defined in the page. Try this instead: `"window.location.href = 'pesquisa.html?re_ligacao';"` – Shadow The GPT Wizard Dec 13 '10 at 20:58
  • Yes, the gotoPage is defined on the document. And the window.location.href gives me the same error (":" was expected) – Paulo Bueno Dec 14 '10 at 10:44

1 Answers1

1

This worked for me in a test page:

IE.document.parentWindow.execScript "RunMe(""hello"")", "jscript"

Tim

Tim Williams
  • 154,628
  • 8
  • 97
  • 125
  • It worked!! Thanks! Anyway i've found that i was referencing the wrong document object since i'm working on a 5 level nested frame html document. – Paulo Bueno Dec 15 '10 at 10:48