I am using Gwt 2.4. After compiling my project i am getting some document.write lines in the mymodle.chache.js which is most weired .
So i want to know the places which producing these lines in my GWT code and came across and found some lines of code like
element.setInnerHtml("blah ..blah..");
and
doc.write("blah..blah ..");
So i removed those line of code and compiled again again and still getting some (ex:document.write(df+er+t)) lines .
Anyone suggest a way to find the cause to producing those lines from my GWT ??
(assuming you’re talking about the
*.nocache.jsfile rather than the*.cache.*files, as*.cache.*don’t contain calls todocument.write, unless you’re using a crappy third-party lib)The
*.nocache.jsfile is generated by the primary linker, so its content is independent from your code. It contains calls todocument.write()for various things: determine your module base URL (as a last resort, when it cannot infer it from elsewhere), inject scripts and stylesheets referenced from your*.gwt.xmlfiles, and finally inject the GWT application code itself (with the standard linker, this will be an<iframe>, with the newerxsiframelinker it’ll be a<script>).If you’re really worried about it, it can be customized quite easily by extending the
CrossSiteIframeLinker(xsiframelinker) and providing different code snippets.Tip: compile with
-style PRETTYto make the generated code readable.