CPWebView: TypeError: Result of expression 'win.document.body' [null] is not an object.

13 views
Skip to first unread message

Ryan Jafari

unread,
Nov 20, 2009, 10:42:04 AM11/20/09
to Cappuccino & Objective-J
I'm having some trouble with putting some HTML content inside a
CPWebView. I've debugged it using Safari's Web Inspector and execution
pauses at the following line:

In [CPWebView _resizeFrame]:

if(win&&win.document){
==> var
_14=win.document.body.scrollWidth,_15=win.document.body.scrollHeight;
_iframe.setAttribute("width",_14);
_iframe.setAttribute("height",_15);
objj_msgSend(_frameView,"setFrameSize:",CGSizeMake(_14,_15));
}else{
CPLog.warn("using default size 800*1600");
objj_msgSend(_frameView,"setFrameSize:",CGSizeMake(800,1600));
}

Exception: TypeError: Result of expression 'win.document.body' [null]
is not an object.

I know this probably doesn't help much but I was just curious of
anyone had any kind of comments on this. Since I haven't been able to
get it to work this way I'll probably try a different method I have in
mind.

Thanks,
Ryan

david_k_hess

unread,
Nov 20, 2009, 3:45:59 PM11/20/09
to Cappuccino & Objective-J
On Nov 20, 9:42 am, Ryan Jafari <ryan.jaf...@gmail.com> wrote:
> I'm having some trouble with putting some HTML content inside a
> CPWebView. I've debugged it using Safari's Web Inspector and execution
> pauses at the following line:
[...]
> Exception: TypeError: Result of expression 'win.document.body' [null]
> is not an object.
[...]

I ran into the same thing when I was using just HTML fragments. When I
changed it to displaying a complete HTML document (including html,
head and body tags) it started working.

Dave

Ryan Jafari

unread,
Nov 23, 2009, 11:16:05 AM11/23/09
to Cappuccino & Objective-J
Thanks for your suggestion Dave.

Ryan
Reply all
Reply to author
Forward
0 new messages