Squire
09-09-2003, 08:10 PM
Hi, I've got a couple of rookie questions for ya... ;)
<html><head>
<script>
var count = 0;
function inccount() {
count++;
if(count==4) {
document.write("Count = " + count);
}
}
</script>
</head><body>
<img src=[etc] onLoad="inccount()" onError="inccount()">
</body></html>
1) When I view this (in IE), I expect count to equal 1 or however many times an event calls inccount(), instead, after a few seconds, I just get "Count = 4" then a ie/c++/runtime error. Is my function looping? How would make it purely event driven?
2) How would I run a local executable (with parameters from a few var's) from js? The only thing I can think of, is to load a small graphic and have an already running program regularly check for its existance. But this wouldn't give me any parameters (or very few at least, if I varie the image source).
Thanks!
<html><head>
<script>
var count = 0;
function inccount() {
count++;
if(count==4) {
document.write("Count = " + count);
}
}
</script>
</head><body>
<img src=[etc] onLoad="inccount()" onError="inccount()">
</body></html>
1) When I view this (in IE), I expect count to equal 1 or however many times an event calls inccount(), instead, after a few seconds, I just get "Count = 4" then a ie/c++/runtime error. Is my function looping? How would make it purely event driven?
2) How would I run a local executable (with parameters from a few var's) from js? The only thing I can think of, is to load a small graphic and have an already running program regularly check for its existance. But this wouldn't give me any parameters (or very few at least, if I varie the image source).
Thanks!