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)
2
  • 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';" Commented Dec 13, 2010 at 20:58
  • Yes, the gotoPage is defined on the document. And the window.location.href gives me the same error (":" was expected) Commented Dec 14, 2010 at 10:44

1 Answer 1

1

This worked for me in a test page:

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

Tim

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.