From: nikola <web...@ya...> - 2005-03-08 15:27:56
|
Hi, I have a *.php popup with form for user to input some text...this text is submited to iframe_page contained in main page... on popup when user submites page this code is executed $content_value = $values->setElementValue($_GET[element_name], $_GET[content_id]); echo '<script language="JavaScript">'; echo'opener.document.location=opener.document.location;'; echo 'window.close();'; echo '</script>'; but this code is also a problem, so I get this error 2005.03.08 16:01:42 com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError SEVERE: runtimeError: message=[Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://goran/im_cms/site/dot_editor/dot_editor_iframe.php?action=openPg&content_id=42] sourceName=[Embedded script] line=[1] lineSource=[null] lineOffset=[0] ... and this is a copy trace: ======= EXCEPTION START ======== Exception class=[org.mozilla.javascript.EvaluatorException] com.gargoylesoftware.htmlunit.ScriptException: Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://root/app/iframe_page.php?action=openPg&content_id=42 (Embedded script#1) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:294) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:712) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:209) at com.gargoylesoftware.htmlunit.html.HtmlScript.appendChild(HtmlScript.java:168) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.handleCharacters(HTMLParser.java:415) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:379) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:361) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2767) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:334) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:258) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:595) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:562) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:185) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) at TestText.testText(TestText.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) Enclosed exception: org.mozilla.javascript.EvaluatorException: Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://goran/im_cms/site/dot_editor/dot_editor_iframe.php?action=openPg&content_id=42 (Embedded script#1) at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeError(StrictErrorReporter.java:114) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1054) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1110) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.put(SimpleScriptable.java:478) at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1347) at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1430) at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1420) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2753) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:149) at org.mozilla.javascript.Context.evaluateString(Context.java:1220) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:289) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:712) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:209) at com.gargoylesoftware.htmlunit.html.HtmlScript.appendChild(HtmlScript.java:168) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.handleCharacters(HTMLParser.java:415) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:379) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:361) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2767) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:334) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:258) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:595) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:562) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:185) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) at TestText.testText(TestText.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) == CALLING JAVASCRIPT == opener.document.location=opener.document.location;window.close(); ======= EXCEPTION END ======== ... there is too much php, and html code to post it all, and I hope that question is not too confusing :) ... so any help is welcome ... thanks... __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |