Executing a JavaScript function without loading a new page

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
bearaman
Posts: 65
Joined: Fri Mar 02, 2007 5:26 pm

Executing a JavaScript function without loading a new page

Post by bearaman » Fri Jun 01, 2007 9:11 am

Hi There,
I'm trying to call a JS function that will load a chart on the right hand side of the page but not load a new page. It works fine when I use URL GOTO=javascript:function(); but it expects a page to be loaded and so times out with an error.
What tag can I use to execute the JS function without loading a new page? It's an internal site so I can't post the URL or share the code :-(
Many Thanks,
Bearaman
bearaman
Posts: 65
Joined: Fri Mar 02, 2007 5:26 pm

Post by bearaman » Thu Jun 07, 2007 11:24 am

Hi Again,
Any ideas out there on running a JS function without using URL GOTO? Also, WINCLICK is not an option before anyone suggests it!
Bearaman
bearaman
Posts: 65
Joined: Fri Mar 02, 2007 5:26 pm

Post by bearaman » Tue Jun 12, 2007 4:33 pm

Hi Again,
Any ideas at all on how to resolve this? Any comments at all would be brilliant. If you need me to clarify my request, then please ask.
Thanks,
Bearaman
mknoll1
Posts: 174
Joined: Fri Dec 23, 2005 4:14 pm

Post by mknoll1 » Fri Jun 22, 2007 2:32 pm

Try this:


SET !ERRORCONTINUE YES
SET !TIMEOUT 10
URL GOTO=javascript:function();
REST OF MACRO


You may also need to add

SET !TIMEOUT SOME BIGGER NUMBER
SET !ERRORCONTINUE NO

before going into the rest of the macro. This is pretty clunky but it seems to work most of the time for me.

I have been working with Iopus for 3 years now and I would be glad to help you on any project you need help with. You can E-mail me at my address in my profile.
bearaman
Posts: 65
Joined: Fri Mar 02, 2007 5:26 pm

Post by bearaman » Wed Sep 12, 2007 9:07 am

Hi mknoll1,
Sorry for the late reply. Yea, that was the thing to do, just set the timeout to something short like 5 seconds. It works really well. Thanks,
John
Post Reply