Jump to content

stevensrmiller

Members
  • Posts

    12
  • Joined

  • Last visited

Previous Fields

  • Languages
    C/C++, Java, Visual Basic

Profile Information

  • Location
    northern Virginia, USA
  • Interests
    Animation, politics, law, games, community theater.

stevensrmiller's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. Added the doctype and html tags. No change in behavior. The problem still comes and goes depending upon whether or not the Chrome Stylist extension is enabled or not. justsomeguy, do you have any extensions that intercept server output enabled? No need to keep working on this, folks. Stylist hasn't been updated in three years, and I can happily live without it. It's clearly a bug in that code, and I'm not eager to pursue it for them.
  2. Ah, I think I found the problem. I have "Chrome Stylist" installed in my extensions. Disabling it made the problem go away. Thanks for your time and effort. Much appreciated!
  3. Well, then let's see if the problem is really in my files. Would you please try this page in a Chrome browser and reload it a few times? When it behaves properly, the output looks like this: « Previous • Home First Second But, when it behaves incorrectly, the output looks like this: « Previous • First Second First Second Can you make the error happen?
  4. Thanks for the suggestions. That avenue doesn't look promising, to me. Maybe someone here could test my code and see if they encounter the same problem?
  5. Done. No effect. Done. No effect either.
  6. I did just save my files as UTF-8. The behavior is unchanged.
  7. Notepad defaults to ANSI, so that's what I've been using.
  8. Good question. No, it behaves properly in the Tryit Editor. Now, maybe Tryit introduces some critical difference over how things run when the browser is getting its HTML directly from the server. When you click "Run" in Tryit, you don't communicate with the server (I think). Instead, you run this JavaScript: submitTryit() //var adrefreshtimer function submitTryit(n) { var text = document.getElementById("textareaCode").value; var ifr = document.createElement("iframe"); ifr.setAttribute("frameborder", "0"); ifr.setAttribute("id", "iframeResult"); document.getElementById("iframewrapper").innerHTML = ""; document.getElementById("iframewrapper").appendChild(ifr); var ifrw = (ifr.contentWindow) ? ifr.contentWindow : (ifr.contentDocument.document) ? ifr.contentDocument.document : ifr.contentDocument; ifrw.document.open(); ifrw.document.write(text); ifrw.document.close(); //23.02.2016: contentEditable is set to true, to fix text-selection (bug) in firefox. //(and back to false to prevent the content from being editable) //(To reproduce the error: Select text in the result window with, and without, the contentEditable statements below.) if (ifrw.document.body && !ifrw.document.body.isContentEditable) { ifrw.document.body.contentEditable = true; ifrw.document.body.contentEditable = false; } // if (!adrefreshtimer) {adrefreshtimer = new Date().getTime();} // if (new Date().getTime() - adrefreshtimer >= 30000) { // if (n == 1) { // googletag.cmd.push(function() { // googletag.pubads().refresh([gptAdSlots[0]]); // }); // } // adrefreshtimer = new Date().getTime(); // } } I'm a JavaScript noob, as yet, but it looks to me like this line reads the JavaScript in the code window: var text = document.getElementById("textareaCode").value; And it looks to me like this line writes that JavaScript to the result window: ifrw.document.write(text); That would appear to be a purely synchronous operation, whereas I am guessing (and just guessing, mind you ) that this problem arises when the include is executed asynchronously with transmissions from the server. W3's code looks like it tries to handle that with this line in their function: if (xhttp.readyState == 4 && xhttp.status == 200) as I believe that hard-coded 4 tests for the page being done loading. So, it ought to work. And it does in most browswers, and for most pages. The only time I see a problem is in Chrome, with a really short page. That just smells like a synchronization error, to me. What's your take?
  9. I pulled out the source from w3schools' JavaScript file, and made a change that seems to make the problem go away. But it's not a lasting fix as it relies on a deprecated operation. I hope someone here can have a look at the stackoverflow link, above, and help me understand that I'm seeing.
  10. I've encountered a problem with the w3IncludeHTML function in http://www.w3schools.com/lib/w3data.js. I've posted a question about it at http://stackoverflow.com/questions/40162907/w3includehtml-sometimes-includes-twice. Most forums discourage reposting the same question in more than one place. What's the protocol here? This community is probably more likely to have folks who can help with my issue, but I don't want to start off with poor manners. Please let me know how best to ask for help. Thanks!
  11. Greetings! I'm Stevens Miller, of northern Virginia, USA (near the capital city of the United States, Washington DC). I learned how to program in BASIC, back in the '70s. I'm a pretty good C/C++ and Java programmer now. I do a lot of work with computer graphics and also the XBox 360 controller. Learning more about HTML5 and Javascript lately. I'm a moderator of the Games forum at coderanch.com. Hope to make new friends here.
×
×
  • Create New...