Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

I need help with this code. Can you help me fix it?

May 9, 2013 3:53AM PDT

Here is the code:

<script type='text/javascript'>

(function() {

var useSSL = 'https:' == document.location.protocol;

var src = (useSSL ? 'https:' : 'http:') +

'//www.googletagservices.com/tag/js/gpt.js';

document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');

})();

</script>

Discussion is locked

- Collapse -
Answer
(NT) What's wrong with it?
May 9, 2013 3:58AM PDT
- Collapse -
This one line of code.
May 9, 2013 4:05AM PDT

This line has an error according to my blogger template...

document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');


When I enter the the whole code in my blog I get this error message:

Error parsing XML, line 15, column 23: Element type "scr" must be followed by either attribute specifications, ">" or "/>".

I've tried adding > but, it still doesn't work on my blog.

- Collapse -
Re: error
May 9, 2013 5:21PM PDT
- Collapse -
Re: error
May 9, 2013 11:20PM PDT

I see the forum software and my browser accepted my solution. But for humans it should read as:

Change the < to &lt;

Kees