Package com.gargoylesoftware.htmlunit.javascript

Examples of com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction()


            else {
                thisValue = this;
            }
            for (int i = 0; i < nbExecutions; i++) {
                LOG.debug("Calling onreadystatechange handler for state " + state);
                jsEngine.callFunction(containingPage_, stateChangeHandler_, context,
                        scope, thisValue, ArrayUtils.EMPTY_OBJECT_ARRAY);
                LOG.debug("onreadystatechange handler: " + context.decompileFunction(stateChangeHandler_, 4));
                LOG.debug("Calling onreadystatechange handler for state " + state + ". Done.");
            }
        }
View Full Code Here


            if (context == null) {
                context = Context.getCurrentContext();
            }
            final Scriptable scope = loadHandler_.getParentScope();
            final JavaScriptEngine jsEngine = containingPage_.getWebClient().getJavaScriptEngine();
            jsEngine.callFunction(containingPage_, loadHandler_, context, scope, this, ArrayUtils.EMPTY_OBJECT_ARRAY);
        }
    }

    /**
     * Returns the event handler that fires on load.
View Full Code Here

            }
            final Scriptable scope = errorHandler_.getParentScope();
            final JavaScriptEngine jsEngine = containingPage_.getWebClient().getJavaScriptEngine();

            LOG.debug("Calling onerror handler");
            jsEngine.callFunction(containingPage_, errorHandler_, context, this, scope, ArrayUtils.EMPTY_OBJECT_ARRAY);
            LOG.debug("onerror handler: " + context.decompileFunction(errorHandler_, 4));
            LOG.debug("Calling onerror handler done.");
        }
    }
View Full Code Here

        if (!getWebClient().isJavaScriptEnabled()) {
            return new ScriptResult(null, this);
        }

        final JavaScriptEngine engine = getWebClient().getJavaScriptEngine();
        final Object result = engine.callFunction(this, function, thisObject, args, htmlElementScope);

        return new ScriptResult(result, getWebClient().getCurrentWindow().getEnclosedPage());
    }

    /** Various possible external JavaScript file loading results. */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.