Ad
Imacros Javascript Window.onload Not Working
Ive ran my script a couple of times and cant figure out why the window.onload isnt working. What am I not doing right ?
var macro = "CODE:";
macro += "VERSION BUILD=9002379" + "\n";
macro += "TAB T=1" + "\n";
macro += "TAB CLOSEALLOTHERS" + "\n";
macro += "SET !EXTRACT_TEST_POPUP YES" + "\n";
macro += "SET !TIMEOUT_STEP 60" + "\n";
macro += "SET !TIMEOUT_PAGE 60" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !DATASOURCE C:\\imacros\\test.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1" + "\n"
macro += "SET !DATASOURCE_LINE 1" + "\n";
macro += "URL GOTO={{!COL1}}" + "\n";
function addlisteners(){
window.alert("Boo !");
}
window.onload = addlisteners;
iimPlay(macro);
Ad
Answer
I am not sure what you tried to do with the script above but this code works fine.
var macro = "CODE:";
macro += "VERSION BUILD=9002379" + "\n";
macro += "TAB T=1" + "\n";
macro += "TAB CLOSEALLOTHERS" + "\n";
macro += "SET !EXTRACT_TEST_POPUP YES" + "\n";
macro += "SET !TIMEOUT_STEP 60" + "\n";
macro += "SET !TIMEOUT_PAGE 60" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !DATASOURCE C:\\imacros\\test.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1" + "\n"
macro += "SET !DATASOURCE_LINE 1" + "\n";
macro += "URL GOTO={{!COL1}}" + "\n";
iimPlay(macro);
addlisteners();
function addlisteners() {
alert("Boo !");
}
How about now?
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad