SRC parameter not working in Mozilla when path is included

Discussion in 'Firefox' started by wylbur37, Jan 2, 2004.

  1. wylbur37

    wylbur37 Guest

    (This is a re-post of something that apparently did not post correctly
    the first time, so if there's more than one copy, please ignore the
    duplicate).

    I normally use Mozilla 1.4 on Windows XP Pro.
    As I was developing some test webpages, I discovered that the SRC
    parameter doesn't seem to work when a path is used with the filename.

    In one example, when I want to run a JavaScript from an external file
    (i.e., not inline), I would do the following ...

    <SCRIPT LANGUAGE="JavaScript" SRC="program.js"> </SCRIPT>

    If "program.js" were in a different subdirectory than the .htm file
    referring to it, the filename would have to be prefixed by the
    pathname as follows ...

    <SCRIPT LANGUAGE="JavaScript" SRC="/mydir/program.js"> </SCRIPT>

    But when I ran the above from within an .htm file loaded locally into
    Mozilla, it did not work. (The result was as if the above code weren't
    there). However, when I ran the identical code on Internet Explorer
    (v.6), it worked.


    In another, even simpler example, the code to put an image on a
    webpage is ...

    <img src="picture.jpg">

    Again, if "picture.jpg were in a different subdirectory than the .htm
    file referring to it, the filename would have to be prefixed by the
    pathname as follows ...

    <img src="/mydir/picture.jpg">

    When I ran the above from within an .htm file loaded locally into
    Mozilla, it did not work. (The result was as if the above code weren't
    there). However, when I ran the identical code on Internet Explorer
    (v.6), it worked.


    By the way, I tried using backslashes instead of forward slashes. In
    both cases, it still worked on Internet Explorer but not on Mozilla.


    The SRC parameter seems like a fairly frequently used parameter for
    the developers of Mozilla to overlook it. Is this really a bug in
    Mozilla or is it just some option/switch in Mozilla that I didn't set
    properly?


    __________________________________
    Do you Yahoo!?
    Find out what made the Top Yahoo! Searches of 2003
    http://search.yahoo.com/top2003
    wylbur37, Jan 2, 2004
    #1
    1. Advertising

  2. wylbur37

    Michael C. Guest

    On Fri, 2 Jan 2004 06:11:14 -0800 (PST),
    wylbur37 <> wrote:
    > (This is a re-post of something that apparently did not post correctly
    > the first time, so if there's more than one copy, please ignore the
    > duplicate).
    >
    > I normally use Mozilla 1.4 on Windows XP Pro.
    > As I was developing some test webpages, I discovered that the SRC
    > parameter doesn't seem to work when a path is used with the filename.
    >
    > In one example, when I want to run a JavaScript from an external file
    > (i.e., not inline), I would do the following ...
    >
    > <SCRIPT LANGUAGE="JavaScript" SRC="program.js"> </SCRIPT>
    >
    > If "program.js" were in a different subdirectory than the .htm file
    > referring to it, the filename would have to be prefixed by the
    > pathname as follows ...
    >
    > <SCRIPT LANGUAGE="JavaScript" SRC="/mydir/program.js"> </SCRIPT>
    >


    Try

    <SCRIPT LANGUAGE="JavaScript" SRC="file:///mydir/program.js">
    </SCRIPT>

    or

    <SCRIPT LANGUAGE="JavaScript"
    SRC="http://my.server.org/mydir/program.js">
    </SCRIPT>

    AFAIK, you don't assume a server. Just because it works in IE, doesn't
    make it correct. And don't use backslashes, IE might not balk at them,
    but if you ever want to view the files in anything but IE, you'll be
    disappointed.

    HTH,

    Michael C.
    --
    http://mcsuper5.freeshell.org/

    If we cease to judge this world, we may find ourselves, very quickly, in
    one which is infinitely worse. - Margaret Atwood
    Michael C., Jun 5, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wylbur37
    Replies:
    1
    Views:
    506
    Hywel Jenkins
    Jan 2, 2004
  2. DW
    Replies:
    7
    Views:
    25,994
    lbellysmit
    Jan 3, 2011
  3. lisaj
    Replies:
    0
    Views:
    1,030
    lisaj
    Apr 3, 2008
  4. Martin Krag

    Long Path Tool - Fix Path Too Long Forever

    Martin Krag, Mar 31, 2011, in forum: Windows 64bit
    Replies:
    0
    Views:
    1,352
    Martin Krag
    Mar 31, 2011
  5. Martin Krag

    Long Path Tool - Fix Path Too Long Forever

    Martin Krag, Mar 31, 2011, in forum: Wireless Networking
    Replies:
    1
    Views:
    2,221
    robinst
    Dec 15, 2012
Loading...

Share This Page