Search Results

Search found 1 results on 1 pages for 'pingrey'.

Page 1/1 | 1 

  • Controlling the scope of a document.write call coming from a third party

    - by pingrey
    Dear all, I'm writing a webpage that relies on an external javascript file (that I have no control of), which returns data by using document.write's. Is there any way to dynamically call the function without it overwriting the whole document? The most concise code I can think of is below: <html> <head> <script type="text/javascript"> function horriblefunction () { document.write("new text"); } </script> </head> <body> Starting Text... <div id="pleasewriteinme"></div> Other text... <button onclick="horriblefunction();">Click</button> </body> </html> The idea beginning that without altering "horriblefunction()" (as it's external) the new text could be placed in the div instead of overwriting the page. Is this possible or does the function have to be called inside the div as the page is created? Thanks for you help

    Read the article

1