/    Sign up×
Community /Pin to ProfileBookmark

javascript is not Jscript

hi i wrote a litte program in javascript to display the next event on a site , this is done by reading a text file on the server , and then fill some arrays and put it on the screen
but it only seems to work in Firefox and not in IE , i think it is because Firefox uses the java from sun and IE uses its own Jscript to run the script , is ther a way around to tell IE to also use the java from sun ?? or can i write this in a way it works in IE ??
i’ll show the part of the code i thing is not working in IE

[CODE]
var datafile = window.location.href.substring(0,
window.location.href.lastIndexOf(“/”) + 1) +
“agenda.txt”;
var url = new java.net.URL(datafile);
var connect = url.openConnection();
var input = new java.io.BufferedReader(
new java.io.InputStreamReader(
connect.getInputStream()));

var aLine = “”;
var datum = new Array();
var info = new Array();
var waar = new Array();
var url = new Array();
aLine = input.readLine();
var i = 0;
do
{
// document.write(i);
datum[i] = aLine;
aLine = input.readLine();

info[i] = aLine;
aLine = input.readLine();

waar[i] = aLine;
aLine = input.readLine();

url[i] = aLine;
i++;
}
while((aLine = input.readLine()) != null)[/CODE]

for a demo of the problem see the box on the right side on top of
[URL]http://users.telenet.be/slenders001/EMTv2/index.html[/URL]

the error in IE is that java is not defined

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorAug 21.2006 — Do u really need Java (which is an other type of language than javascript)? If so, shall I move your thread to the Java Forum? Or? I really don't understand your [I]javascript[/I] problem...
Copy linkTweet thisAlerts:
@felgallAug 22.2006 — Looks like a Java question to me but the problem is that Java isn't installed by default in IE and just needs to be downloaded installed. The code is using Javascript/JScript to call Java to read the file. It therefore needs Java to be installed in the browser.

Javascript != JScript != Java
Copy linkTweet thisAlerts:
@slendersauthorAug 22.2006 — ok , and i cant just force eveyone that comes on the page to install java in IE

is there an other way to just use javascript to read an external file to get data or arrays ? because i use the same data in 2 other scripts on other pages that have the same problem

the problem is i cant use PHP on the server ?
Copy linkTweet thisAlerts:
@slendersauthorAug 22.2006 — i think i already know something , stupid me , almost sead it myself , just another data.js that declares the arrays ?
×

Success!

Help @slenders spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...