Image onload function doesn't work

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
Ruriko
Posts: 126
Joined: Sat Feb 24, 2007 5:07 am

Image onload function doesn't work

Post by Ruriko » Sun Jan 13, 2013 11:51 am

I am trying to get the image width but it doesn't seem to recognise new Image()

Code: Select all

TAB T=1
TAG POS=1 TYPE=IMG ATTR=SRC:* EXTRACT=HREF
SET !VAR1 EVAL("var img = new Image(); img.onload = function() { alert(this.width); }; img.src =\"{{!EXTRACT}}\"; ")
SET !EXTRACT NULL
PROMPT {{!VAR1}}

I get error saying:

Code: Select all

ReferenceError: Image is not defined, line: 4 (Error code: -1001)
Can someone help me fix?
lostandleft
Posts: 15
Joined: Sun Oct 14, 2012 8:26 pm

Re: Image onload function doesn't work

Post by lostandleft » Sun Jan 13, 2013 7:12 pm

Ruriko
Posts: 126
Joined: Sat Feb 24, 2007 5:07 am

Re: Image onload function doesn't work

Post by Ruriko » Sun Jan 13, 2013 10:32 pm

This error is different from that thread. I am not using Firefox 18 but Firefox 16
Post Reply