SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    0 Post(s)
    0 Thread(s)

    cascade external javascript

    I've been wracking my brain in this one for hours, and can't get it to work. I want to have a simple web page that references an external js on the local hard drive, and inside that local js I want code that references a js on an ftp server on the net somewhere. The end result I'm looking for is that when I change the file on the server, a little box on the user's screen will turn into a link and start flashing. I'm kind of new with javascript and am just trying to get this done.

    To clarify a bit more:

    I have built a web page that references statically named .js files, for example js1.js. These names will always stay the same, so the web page code is never changed. Both of these files are local on a pocket pc 2003 "PIE" browser. The js1.js file is supposed to point to a file on my ftp server named js1.0001.js. This file contains a link to a CAB file (like a setup.exe for desktop windows) that will install documents onto the pocket pc and change the contents of js1.js to point to the next sequential file on the ftp server, js1.0002.js. If I have not created js1.0002.js, it will just have a blank space on the web page. If js1.0002.js does exist, then an animated gif will appear that is also a link to the aforementioned cab file.

    I try to think of it as a multiple redirect, something like passing the buck, so to speak.
    web page "look at js1.js to fill this spot in my page"
    js1.js "don't look at me, look at js1.0001.js. Insert it's code into your page"
    js1.0001.js "Ok, here's a hyperlink with a nifty flashing gif pointing to a cab file"

    I hope that makes sense.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    West Springfield, Massachusetts
    198 Post(s)
    3 Thread(s)

    js files

    Hi mot, welcome to the forums,
    I think the problems you are experiencing may have something to do with browser security limitations.
    If you have PHP maybe you could link directly to the server js file (using a content-type = javascript header) and use the "last modified" value to control whether the link flashes or not.


Posting Permissions

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