Re: Callback with writeCapture

121 views
Skip to first unread message

noah

unread,
Dec 2, 2011, 7:49:21 AM12/2/11
to writecaptu...@googlegroups.com

It's probably an error in the script you're loading. Please create a working example here: http://jsfiddle.net/

On Dec 2, 2011 2:09 AM, "rsboarder" <rsbo...@gmail.com> wrote:
I have script wich i load with this way:

$(funcion() {
var html = ''
html += "<script type="text/javascript" src="http://example.com/
test.js
"></script>"

$('#divid').html(writeCapture.sanitize(html,function(){
 // if my test.js returns special content i do this:

var cap = ""
cap += "<script type="text/javascript" src="http://example.com/
example.js"></script>"
$('#divid').html(writeCapture.sanitize(cap))
})
})

But i have error NOT_FOUND_ERR: DOM Exception 8. Where is my mistake?

Константин Сергиенко

unread,
Dec 5, 2011, 1:07:36 AM12/5/11
to writecaptu...@googlegroups.com
Script is loading ads well but with error in console, but in IE ads doesn't show at all.  http://jsfiddle.net/rsboarder/AY7YN/1/



2011/12/2 noah <iam...@gmail.com>

noah

unread,
Dec 5, 2011, 9:36:38 AM12/5/11
to writecaptu...@googlegroups.com
I can't get that js fiddle to work at all. You don't appear to be
including write capture. Also, please indent your code. If the ad is
working in a particular browser, the fiddle should also work in that
browser, but that does not do anything in any browser I tried.

Sean Ford

unread,
Dec 5, 2011, 10:20:53 AM12/5/11
to writecaptu...@googlegroups.com
So, a couple things on your ad implementation.

1. It's not clear to me if you've already done this on your webpage, but your example doesn't appear to be using the standard jQuery doc ready statement, $(document).ready(function() {...}); Is that on purpose?

2. Try using writeCapture in your jQuery string a little differently. I think this might work better for you: $('#divid92374').writeCapture().html(yourAdString); Because this way you're inserting the finished product into the DOM. Probably not a big difference, but it works for me.

2. writeCapture is a default asyncronous call, you don't want that for your ads. You want to modify the loadSync function by adding async:false, because otherwise you run the risk of writeCapture digging into the actual ad code from the ad server and modifying well beyond where you expect it to. BTDT
--
Sean [02 Saab 9-3 Conv]

Константин Сергиенко

unread,
Dec 6, 2011, 2:44:11 AM12/6/11
to writecaptu...@googlegroups.com
Update the code. Now, first ads doesn't appends into the DOM. But, if you will open ads directly in URL there will be document.write. 


2011/12/5 noah <iam...@gmail.com>
Message has been deleted

rsboarder

unread,
Dec 6, 2011, 8:05:39 AM12/6/11
to writeCapture.js Users
Forgot to give adress http://jsfiddle.net/rsboarder/AY7YN/4/

On 6 дек, 11:44, Константин Сергиенко <rsboar...@gmail.com> wrote:
> Update the code. Now, first ads doesn't appends into the DOM. But, if you
> will open ads directly in URL there will be document.write.
>

> 2011/12/5 noah <iamn...@gmail.com>


>
>
>
>
>
>
>
> > I can't get that js fiddle to work at all. You don't appear to be
> > including write capture. Also, please indent your code. If the ad is
> > working in a particular browser, the fiddle should also work in that
> > browser, but that does not do anything in any browser I tried.
>
> > On Mon, Dec 5, 2011 at 12:07 AM, Константин Сергиенко
> > <rsboar...@gmail.com> wrote:
> > > Script is loading ads well but with error in console, but in IE ads
> > doesn't
> > > show at all.  http://jsfiddle.net/rsboarder/AY7YN/1/
>

> > > 2011/12/2 noah <iamn...@gmail.com>


>
> > >> It's probably an error in the script you're loading. Please create a
> > >> working example here:http://jsfiddle.net/
>

noah

unread,
Dec 6, 2011, 9:42:47 AM12/6/11
to writecaptu...@googlegroups.com
I see two problems:

1) For some reason, there is an error on this line:
https://github.com/iamnoah/writeCapture/blob/master/writeCapture.js#L669

You might try putting a try catch around that, as it shouldn't cause
write capture to abort.

2) There is a VBScript tag in some HTML that is sanitized. Write
Capture ignores VBScript tags and just passes them through, but jQuery
is trying to execute it, and it causes an exception. You could try
removing that tag and see if the ad still renders (it appears to be
some sort of flash fallback). Write Capture does something similar
here: https://github.com/iamnoah/writeCapture/blob/master/writeCapture.js#L409

Константин Сергиенко

unread,
Dec 6, 2011, 12:26:05 PM12/6/11
to writecaptu...@googlegroups.com

If there is VBscript, then why IE doesn't render the code and Chrome renders it well?

06.12.2011 18:42 пользователь "noah" <iam...@gmail.com> написал:

noah

unread,
Dec 6, 2011, 12:29:34 PM12/6/11
to writecaptu...@googlegroups.com
The VBScript is written as part of a conditional that only executes in
IE. Like I said, you could probably take it out without much harm.
Message has been deleted

rsboarder

unread,
Dec 19, 2011, 6:52:42 AM12/19/11
to writeCapture.js Users
So, in function proxyTag i added this:

if(!isJs) {
lang = lang.toLowerCase()
if(lang == 'vbscript') element = ''
return element;
}

It removes script with vbscript, but IE now gets from ads server only
images, no flash at all. If i undo changes the error returns.
And I gues that the problem is not in VBscript, but in comment "on
error resume next" which included in VBscript tag. So, plugin doesn''t
works correctly with this comments. Is it possible to fix?

On 6 дек, 21:29, noah <iamn...@gmail.com> wrote:
> The VBScript is written as part of a conditional that only executes in
> IE. Like I said, you could probably take it out without much harm.
>

> On Tue, Dec 6, 2011 at 11:26 AM, ëÏÎÓÔÁÎÔÉÎ óÅÒÇÉÅÎËÏ


>
>
>
>
>
>
>
> <rsboar...@gmail.com> wrote:
> > If there is VBscript, then why IE doesn't render the code and Chrome renders
> > it well?
>

> > 06.12.2011 18:42 ÐÏÌØÚÏ×ÁÔÅÌØ "noah" <iamn...@gmail.com> ÎÁÐÉÓÁÌ:


>
> >> I see two problems:
>
> >> 1) For some reason, there is an error on this line:
> >>https://github.com/iamnoah/writeCapture/blob/master/writeCapture.js#L669
>
> >> You might try putting a try catch around that, as it shouldn't cause
> >> write capture to abort.
>
> >> 2) There is a VBScript tag in some HTML that is sanitized. Write
> >> Capture ignores VBScript tags and just passes them through, but jQuery
> >> is trying to execute it, and it causes an exception. You could try
> >> removing that tag and see if the ad still renders (it appears to be
> >> some sort of flash fallback). Write Capture does something similar
> >> here:
> >>https://github.com/iamnoah/writeCapture/blob/master/writeCapture.js#L409
>

> >> On Tue, Dec 6, 2011 at 7:05 AM, rsboarder <rsboar...@gmail.com> wrote:
> >> > Forgot to give adresshttp://jsfiddle.net/rsboarder/AY7YN/4/


>
> >> > On 6 ÄÅË, 11:44, ëÏÎÓÔÁÎÔÉÎ óÅÒÇÉÅÎËÏ <rsboar...@gmail.com> wrote:
> >> >> Update the code. Now, first ads doesn't appends into the DOM. But, if
> >> >> you
> >> >> will open ads directly in URL there will be document.write.
>
> >> >> 2011/12/5 noah <iamn...@gmail.com>
>
> >> >> > I can't get that js fiddle to work at all. You don't appear to be
> >> >> > including write capture. Also, please indent your code. If the ad is
> >> >> > working in a particular browser, the fiddle should also work in that
> >> >> > browser, but that does not do anything in any browser I tried.
>

> >> >> > On Mon, Dec 5, 2011 at 12:07 AM, ëÏÎÓÔÁÎÔÉÎ óÅÒÇÉÅÎËÏ


> >> >> > <rsboar...@gmail.com> wrote:
> >> >> > > Script is loading ads well but with error in console, but in IE ads
> >> >> > doesn't

> >> >> > > show at all. šhttp://jsfiddle.net/rsboarder/AY7YN/1/


>
> >> >> > > 2011/12/2 noah <iamn...@gmail.com>
>
> >> >> > >> It's probably an error in the script you're loading. Please create
> >> >> > >> a
> >> >> > >> working example here:http://jsfiddle.net/
>
> >> >> > >> On Dec 2, 2011 2:09 AM, "rsboarder" <rsboar...@gmail.com> wrote:
>
> >> >> > >>> I have script wich i load with this way:
>
> >> >> > >>> $(funcion() {
> >> >> > >>> var html = ''
> >> >> > >>> html += "<script type="text/javascript" src="http://example.com/
> >> >> > >>> test.js"></script>"
>
> >> >> > >>> $('#divid').html(writeCapture.sanitize(html,function(){

> >> >> > >>> š// if my test.js returns special content i do this:

noah

unread,
Dec 19, 2011, 7:36:22 AM12/19/11
to writecaptu...@googlegroups.com

So jQuery is what is executing the script, but AFAIK, there isn't a way to dynamically execute VBScript.

Константин Сергиенко

unread,
Dec 19, 2011, 8:14:23 AM12/19/11
to writecaptu...@googlegroups.com
So there is no way to fix it?

2011/12/19 noah <iam...@gmail.com>

noah

unread,
Dec 19, 2011, 9:57:27 AM12/19/11
to writecaptu...@googlegroups.com
I should've said I don't know of a good way to fix this. In any case,
writeCapture isn't doing the interpreting/execution, so there isn't
anything we can do.

Константин Сергиенко

unread,
Dec 20, 2011, 2:31:07 AM12/20/11
to writecaptu...@googlegroups.com
I decided to catch VBscript and to rewrite it. As a result i have this:

if(!isJs) {
lang = lang.toLowerCase()
if(lang == 'vbscript') {
element = ''

element = '<script type="text/javascript">plugin=IsObject( new
ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"))</script>'

element = runInline;
}
}

But this doen't firese from the plugin. How to fire it?

2011/12/19 noah <iam...@gmail.com>

Константин Сергиенко

unread,
Dec 21, 2011, 6:39:34 AM12/21/11
to writecaptu...@googlegroups.com
Any ideas?


2011/12/20 Константин Сергиенко <rsbo...@gmail.com>:

Константин Сергиенко

unread,
Dec 23, 2011, 7:57:34 AM12/23/11
to writecaptu...@googlegroups.com
So, i decided to remove script wich loads flash with VBscript from
callback and to check every 1 second state of plugin. On DIV where i
load writecapture i put some data

jQuery(el).data('progress',true); // line ~852

Then when result appends to the DIV i want to remove data, but i can't
find where exactly html appends to the DIV. Can you help me?


2011/12/21 Константин Сергиенко <rsbo...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages