paul at boddie.org.uk
Tue Oct 16 12:16:44 CEST 2007
On 11 Okt, 08:23, IamIan <ian... at gmail.com> wrote:
> My website is built from a Python CGI and works great. I'm now
> first contains the display settings for the ads, and the second piece
> is a very lengthy garbled js file athttp://pagead2.googlesyndication.com/pagead/show_ads.js
Shudder! I don't think I'm even going to look at that.
> correctly, however the second file throws an "unterminated string
> literal" js error. Looking at it you can see a healthy amount of both
> single and double quotes, which is where my problem lies.
> What is the best way to get the second js file into a nice printable/
> usable format? cgi.escape? xml.sax.saxutils.quoteattr? String
> substitution? I could use some guidance.
don't need to think about encoding, escaping or quoting it since the
inline (actually embedded in the HTML page), then it may help to
include it in a CDATA section. I recall various tricks that may be
necessary, especially when dealing with Internet Explorer brokenness,
but not having to serve Windows users any more (particularly those who
also like ActiveX and think it's part of the Web) means that I don't
care about or recall those tricks readily. Pretending that IE doesn't
support lots of standards usually sets you off on the right foot,
More information about the Python-list