SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question open a file with javascript

    Goodday!

    hope someone can help.
    I have a hyperlink that currently links to nowhere. I want to be able to launch or open a program by clicking onto a hyperlink.. I thought that with windows it will automatically launch a player to show the movie... but this did not happen.

    I know its possible in javascript...but I not so good in javascript
    my link looks like this:
    Code:
    TEST THIS <a href="i:/localvideo/video/sugarbabe.mpg">Sugar Babe...click here>>></a>
    thank you in advance

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Linking to an MPG should fire up whatever program you have associated with that file type, but as your link is invalid (there is no protocol named 'i') that might be stopping it working.

    Try formatting your local link correctly: file://i:/localvideo/video/sugarbabe.mpg (I think).

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx for quick response. I tried that but it still does not fire up. I thought windows was smart enough to recognise it.

    quick Q:
    do you think it would be possible to direct the hyperlink where to find the media player?? then open media player with file name...

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the media player associated with the '.mpg' file type?

    This technique will only work if you're running your page via the file: protocol as well. If you have a web server and is retrieving the page via HTTP, file: links will not work.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx for the answer!!! now I know why it is not working!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •