Having trouble with IE8

59 views
Skip to first unread message

MasJ

unread,
Sep 11, 2012, 11:16:42 AM9/11/12
to writecaptu...@googlegroups.com
I was using WC1 and decided to test drive WC2 for a bit. Everything works great in Chrome, Safari, etc. but IE8 is messing up with WC2. I'm getting an error on this line:

 

var elems = [curParentNode],

doc = element.ownerDocument ||

element.getOwnerDocument && element.getOwnerDocument();

The specific error I get from the line is:

Object Required

That's part of the element.write library I believe. You can see the error at http://bkpk.me

Also, how do I turn off all the console debug messages with WC2 ? There are so many of them :O

I'd appreciate it if anyone could weigh in on this because I'm not really sure of what the error is about..

 

Thanks for a great library!!

Micky Hulse

unread,
Sep 13, 2012, 4:29:13 AM9/13/12
to writecaptu...@googlegroups.com
Hi,

On Tue, Sep 11, 2012 at 8:16 AM, MasJ <m4s...@gmail.com> wrote:
> I was using WC1 and decided to test drive WC2 for a bit. Everything works
> great in Chrome, Safari, etc. but IE8 is messing up with WC2. I'm getting an
> error on this line:
> That's part of the element.write library I believe. You can see the error at
> http://bkpk.me

Remove this line:

writeCapture.write();

I copied your page to my server, removed the above line and that fixed
it for me.

Also, your HTML appears to be a little funky... SublimeText 2 was
having issues code highlighting, and I think it's due to some invalid
markup... You might do some HTML validating.

Also, I removed <!-- and //--> from your writeCapture lines... Those
are probably superflous in this case.

Lastly, the #ad160 div does not exist on that page... I'd get rid of
that WriteCapture line and the variable for your script.

Also, next time I think it would be best if you made a simple demo
page and posted your code to http://jsbin.com/ (makes it easier for us
to debug and it makes it easier for you to maybe solve problems before
asking for help). :)

> Also, how do I turn off all the console debug messages with WC2 ? There are
> so many of them :O

That's a good question. I think there are tools to remove the
console.log() when creating the minified version for production.

I plan to strip console statements from all my code for a project I'm
working on, and WriteCapture2 will be included. I'll post my findings
in the next few weeks.

> I'd appreciate it if anyone could weigh in on this because I'm not really
> sure of what the error is about..

Let us know if that did not help.

> Thanks for a great library!!

Ditto! Love this code too. :)

MasJ

unread,
Sep 14, 2012, 8:12:05 PM9/14/12
to writecaptu...@googlegroups.com
Hi Micky

Thanks for taking the time to reply.

You're right, maybe a jsbin would've been easier - I'll keep that in mind in the future.

The ad160 div is actually there on some child pages and I've added a conditional to test for it's presence. 

I guess since you posted a followup thread with the same issue vis-a-vis the simple API, we'll continue the discussion there.

Lets hope we can solve this! :)

Micky Hulse

unread,
Sep 14, 2012, 8:16:56 PM9/14/12
to writecaptu...@googlegroups.com
Hi!

On Fri, Sep 14, 2012 at 5:12 PM, MasJ <m4s...@gmail.com> wrote:
> Lets hope we can solve this! :)

Doh! I did not even notice that you were talking about IE8!

When I tested your code I was just using Firefox on Mac. :(

In other words, I did not test your code via IE8... Sorry about that.
I feel stupid.

I'll finish my reply over in the other thread! :D

M

Micky Hulse

unread,
Sep 14, 2012, 9:28:12 PM9/14/12
to writecaptu...@googlegroups.com
On Fri, Sep 14, 2012 at 5:16 PM, Micky Hulse <rgm...@gmail.com> wrote:
> I'll finish my reply over in the other thread! :D

Actually, hehe, I'll just add my thoughts to this thread. ;)

---

Howdy!

On Fri, Sep 14, 2012 at 5:10 PM, MasJ <m4s...@gmail.com> wrote:
> Thanks for posting this followup thread. Just wanted to note that I'm facing
> the exact same issue with WC2 under IE8. I'm using tribalfusion's ads so
> maybe it's an issue with how sequential writes are handled using the simple
> api ?

In a weird sort of way, I'm happy to know that I'm not the only one
having similar issues. :D

> I'm afraid that I couldn't fix it myself otherwise I'd submit a pull
> request. Will try to look into it over the weekend.

Ditto! I think it would take several weeks of my time working with
Noah's amazing code in order for me to understand all of the inner
workings... Maybe then I could know enough to tweak the code and
submit a pull request. Heheehe. :)

So, going back to your code, I've created a bare bones example found here:

<http://jsbin.com/iqijar>

FYI: I noticed that your current site's HTML might have a missing
closing tag of some sorts... Not sure if that would be problematic for
WC2? Unfortunately, I was not able to track down the offending piece
of markup. :(

So, as you can see, I removed that empty writeCapture.write() line...
I figured it was not doing anything useful, so I got rid of it.

I've also added an onload line... No here's the error I'm seeing:

elementwrite.js
Line: 309
Error: Unexpected call to method or property access.

Which starts at line 309:

chars: function( text ) {
if(listen('chars',text) === false) return;
if(module.debug.write) console.log('WRITE chars',text,'el:',element);
curParentNode.appendChild( doc.createTextNode( text ) ); // <---- Line 309.
},

Unfortunately, I don't know enough about TribalFusion ads to know how
things should be setup. For example, is it necessary that you call
this script:

http://tags.expo9.exponential.com/tags/Emuparadiseorg/bkpkme/tags.js

in the same WC2 statement?

Could you call that JS first, outside of any WC2 lines (i.e., maybe in
the <head>) and then just call the other bits using WC2 in footer?

For example:

<http://jsbin.com/iqijar/4>

Hmmm, that does not appear to work. What about:

<http://jsbin.com/iqijar/3>

... hmm, that does not work either.

So, it looks like all that code does need to be in one WC2 line. :D

One interesting thing I noticed was this Firebug warning:

An unbalanced tree was written using document.write() causing data
from the network to be reparsed. For more information
https://developer.mozilla.org/en/Optimizing_Your_Pages_for_Speculative_Parsing
[Break On This Error]
</SCRIPT>

... which happened on the Google Adsense looking ad... But that's the
one ad that I can get to work in IE8, so go figure! :D

I'm stumped. :(

I'll let you know if I get any further with your code.

Cheers,
Micky
Reply all
Reply to author
Forward
0 new messages