Jump to content

ruegen

Members
  • Posts

    9
  • Joined

  • Last visited

ruegen's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I now looks like this: var currentVersion = "1.0";function checkForUpdate(){ var updateRequest = new XMLHttpRequest(); updateRequest.open("GET", "http://site/updaters/update_v.txt", false); updateRequest.send(null); var updateRequestText = updateRequest.responseText; if(updateRequestText == (currentVersion)){ document.getElementById('newUpdate').style.display = 'none'; }}function openLink(url){ if(window.widget){ widget.openURL(url); } else{ window.location = url; }}
  2. I now get "TypeError - Object (result of expression openLink) does not allow calls"I don't get it in my editor but when I test it the link doesn't work.
  3. Many thanks! (still need help though)
  4. Hey the link works, always the simplest things.Now I just have to work out how to make the link disappear and only appear when my app needs updating.
  5. currently I have in the javascript file (file.js) {var currentVersion = "1.0";}{function checkForUpdate(){ var updateRequest = new XMLHttpRequest(); updateRequest.onreadystatechange = nullFunction; updateRequest.open("GET", "http://site/updaters/update_v.txt", false); updateRequest.send(null); var updateRequestText = updateRequest.responseText; if(updateRequestText == (currentVersion)){ document.getElementById('newUpdate').style.display = 'none'; }
  6. In the HTML file I have <a id="updateLink" href="javascript:openLink('WEBPAGE');" style="text-decoration: none; display: block;"> <div id="newUpdate"> New Update<br />Available! </div></a> What I need in the javascript file is when a downloaded txt file (which has the new version number) is not the same as on the javascript file then it displays the above code.When that is displayed you can then click on "new update available" and it "openlink" to a webpage".Does anyone know of a chat room where I can discuss this with someone?NOTE: I removed the real web link with WEBPAGE just for this post.
  7. Thanks but it still doesn't work
  8. I have a problem getting my code to open a weblink. What am I doing wrong? }function openLink(url){ if(window.widget){ closeDesc(); widget.openURL(url); } else{ window.location = url; }
×
×
  • Create New...