Rich-text Reply

Javascript Replacement Error in Variation

jared_owen 02-16-15

Javascript Replacement Error in Variation

Hi I'm trying to add some javascript code to a page variation for a test that displays a new leaderboard advert.

 

This is the code that is being added

 

$(".social-wrapper").html('<script src=\"http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=5578...

 

It replaces the html in a DIV. 

 

And this is the error that keeps occuring, can someone hep me with this?

 

[Messenger] [received] [https://www.optimizelyedit.com] => [https://www.optimizely.com/edit?experime...] evaluation error {"codeType":"EXPERIMENT_JS", "columnNumber":"434", "errorMessage":"TypeError: undefined is not a function", "formattedErrorMessage":"Error evaluating experiment javascript&colon;\nTypeError: undefined is not a function (in function HTMLScriptElement, line 34, col 434)", "inFunction":"HTMLScriptElement", "lineNumber":"34"} [id 29287065-41BB-42CA-B853-54FAE431F6B4

 

Thanks

 

Jared

Amanda 02-17-15
 

Re: Javascript Replacement Error in Variation

Hey Jared -- Check out the response that @bradtaylorsf posted here. It sounds like it should help solve the issue you are highlighting. 

 

Let us know if this does the trick for you!

Optimizely