Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would agree with Squeegy that you best solution is to call a function, but if you are not the author of the included script and must find a solution I would suggest a few things:</p> <p>[EDIT Nov 22 12:27pm]<br/> Now that I better understand that the page you are trying to pull from is a script that returns <code>document.write</code> I think there are 2 options. I've inserted them here with some details and left my original post below for posterity.</p> <p>Option 1:</p> <ul> <li>Create a page that is on your domain that includes the script. For example, it could be called <code>www.yourdomain.com/sportsnetwork/B87/</code>.</li> <li>In the <code>setInterval</code> function build an iframe with that as it's source and inject then into your scoreboard <code>&lt;div&gt;</code>.</li> </ul> <p>Option 2:</p> <ul> <li>Create a page that is on your domain that will parse the sportsnetwork.com page, remove the <code>document.write</code> and pass back html.</li> <li>In the <code>setIntercal</code> function make an ajax request to get the html and insert that into your scoreboard <code>&lt;div&gt;</code>.</li> </ul> <p>Original Option that will not work with <code>document.write</code>:</p> <pre><code>var auto_refresh = setInterval( function () { $('#scoreboard').fadeIn("slow"); var unique = Date.now(); var scriptFile = document.createElement('script'); scriptFile.type = 'text/javascript'; scriptFile.async = true; scriptFile.src = 'http://www.sportsnetwork.com/aspdata/clients/sportsnetwork/pullouts/logoscores/cbaskscoreboard.aspx?team=B87&amp;unique=' + unique; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(scriptFile, s); }, 3000); </code></pre> <p>This will add a new script to the page every 3 seconds and the browser will think think it is a different script due to the <code>unique</code> tag. I think you might need to rework the timing of the fade in relation to the reloading of the script depending on what their relationship is.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload