Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
as shown in script tag, the javascript code is not inlined to htm file. It's referred through various .js file. When I am trying to call a javascript function through WWW::Scripter, it's not working - it says it's unable to find it. Here is the code which I wrote:<script type="text/javascript" src="js/util.js"></script> <script type="text/javascript" src="js/main_page.js"></script> <script type="text/javascript" src="js/page_content.js"></script> <script type="text/javascript" src="js/configurator.js"></script> <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http-equiv="Expires" content="0"/>
Here is the error message: ReferenceError: The variable isValueModified has not been declared at line 1. This isValueModified() function is available in page_content.js file. Please help me how can I invoke the javascript function using WWW::Scripter.use WWW::Scripter; use HTTP::Cookies; my $cookie_jar = HTTP::Cookies->new(); $cookie_jar->set_cookie(.......); my $wi = WWW::Scripter->new(cookie_jar => $cookie_jar); $wi->use_plugin('Ajax'); $wi->credentials($loginUser, $loginPass); $wi->get("http://$ip/simpleSetup.htm"); $wi->get('javascript:isValueModified');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Scripter calling javascript function of .js file
by Corion (Patriarch) on Mar 18, 2011 at 06:39 UTC |