PDA

View Full Version : linking from your website to a CD-ROM


wwwolf
03-20-2003, 02:52 PM
I hope I ask this question in the right forum: if not, sorry!

BACKGROUND: I am making a website for educational purposes. Because not all of the students have a broadband internet connection, we want to put the video's on a CD-ROM, making hyperlinks on the site to the local CD-ROM.

Since we do not know which drive contains the CD-ROM (D: or E: ... depending on the configuration of the student's computer): is it possible that by means of a Javascript (or something else) the student is asked where the CD-ROM is located and that all hyperlinks referring to the CD-ROM are correctly understood after having answered this question?

I hope someone can help me with this... Thanks!
Wolf

liorean
03-20-2003, 03:19 PM
JavaScript can't even reach out of the current domain, much less reach 'cross protocols...

You'll have to use an ActiveX control, a Java applet, or a custom written plugin.

wwwolf
03-20-2003, 03:45 PM
Thanks for your reply. Any ideas on where I can find what is suggested by liorean?

Spudhead
03-20-2003, 04:05 PM
I don't think that's right. With some sort of server-side scripting, (ie ASP), all you need are session variables.

When a visitor arrives, you ask them if they have the CD. If no, you set a session variable (say "hasCD") to false. If yes, you ask them to enter their CD drive's letter, and set another session variable ("cdDrive") to the letter.

You have a makeLink function for every link:

function makeLink(filename){
var strLink
if(!Session("hasCD"){
strLInk=Server.MapPath(".")+"/videos/"+filename;
}
else{
strLink=Session("cdDrive")+":\\videos\\"+filename;
}
return strLink
}

called via:

<a href="<%=makeLink("myVideo.mpg")%>">click</a>


Code might need a bit of work, it's untested :) but unless I'm misunderstanding something the theory should work.

arnyinc
03-20-2003, 04:26 PM
Using Spudhead's idea, I think you could even do this with cookies in javascript. You'd have to ask the user to specify their CD drive, then save it and look it up.

Not the best solution, but the easiest to implement if you don't want to go with any server side stuff.

Spudhead
03-20-2003, 04:50 PM
True, true :thumbsup:

Jerome
03-20-2003, 06:01 PM
Just a thought, why don't You make it the other way, e.g. a website with everything incl. video etc. and put this on a CD with a link to a website for new information etc.

This way the students can even take there CD at home and see mostly everything, or when they have internet ofcourse everything, it worked for me that way,

Jerome