Bugs item #2005930, was opened at 2008-06-29 17:38
Message generated for change (Comment added) made by asashour
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2005930&group_id=47038Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Latest code in SVN
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Sung-Ahn Kim (ccoroom)
>Assigned to: Ahmed Ashour (asashour)
Summary: [JavaScript] Fail to add new <script>.
Initial Comment:
HtmlUnit fail to add new variable 'abc' on Firefox configuration. This is a part of mootools library code. This works fine on web browsers. But, not in htmlUnit.
This issue is from the mailing list thread:
http://www.nabble.com/Dynamically-adding-new-%3Cscript%3E-element.-to18171285.html#a18181232----
<html>
<head>
<script>
function test() {
execMe('var abc = 42;');
}
function execMe(text){
if (!text) return text;
if (window.execScript){
window.execScript(text);
} else {
document.head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.text = text;
document.head.appendChild(script);
document.head.removeChild(script);
}
return text;
}
</script>
</head>
<body>
<input id=myId type=button onclick='test()' value='Test'>
</body>
</html>
----
page.executeJavaScript("test();");
page.executeJavaScript("abc;").getJavaScriptResult(); // result 'undefined'
----------------------------------------------------------------------
>Comment By: Ahmed Ashour (asashour)
Date: 2008-07-01 17:08
Message:
Logged In: YES
user_id=950730
Originator: NO
Thanks for reporting, fixed in SVN
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2005930&group_id=47038-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop