Forum Discussion
han
14 years agoContributor
Of course I understand there has to be a Javascript function to be able to call it from inside the TC script.
Let me do another "demo":
Create a html page like:
The page works in both IE (9) and FF (6) using the html button.
But in TC I can just call the script in FF!?
Checking the object browser:
Page(page_URL).contentDocument.Script - shows for FF
Page(page_URL).Application.document.Script - Isn't showing for IE and the document has only "Fields" and no "Properties"
What makes TC not recognize the Script?
Why is TC showing fields instead of properties?
(I sometimes get the opposite behavior (IE working and FF not working) on other html pages)
Best regards Håkan
Let me do another "demo":
Create a html page like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<SCRIPT LANGUAGE="JavaScript">
function displayDate() {
document.getElementById("demo").innerHTML = Date();
}
</script>
</head>
<body>
<p id="demo">Test Area</p>
<button type="button" onclick="displayDate()">Display Date</button>
</body>
</html>
The page works in both IE (9) and FF (6) using the html button.
But in TC I can just call the script in FF!?
function Test(){
//IE
var pageIE = Sys.Process("iexplore").Page("*demo.htm");
pageIE.Application.Document.Script.displayDate();
//FF
var pageFF = Sys.Process("firefox").Page("*demo.htm");
pageFF.contentDocument.Script.displayDate();
}Checking the object browser:
Page(page_URL).contentDocument.Script - shows for FF
Page(page_URL).Application.document.Script - Isn't showing for IE and the document has only "Fields" and no "Properties"
What makes TC not recognize the Script?
Why is TC showing fields instead of properties?
(I sometimes get the opposite behavior (IE working and FF not working) on other html pages)
Best regards Håkan