ruegen
-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by ruegen
-
-
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; }}
-
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.
-
Many thanks! (still need help though)
-
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.This thread is going to go forever unless you show us the whole page( or at least all of the javascript )..Not being rude, it's just not possible to help you properly without the code Thanks, -
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'; }
-
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.
-
Thanks but it still doesn't workOh ya? Well, you better put that coffee away. :)And it works if you fix up the { and }'s. So go fix that up, person who's name i'm too lazy to copy and paste. -
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; }
Help - need to open link
in JavaScript
Posted