IE6 acting weird with relative include of js and css files having ..in the beginning

Discussion in 'HTML' started by Imran Sadat, Jan 11, 2008.

  1. Imran Sadat

    Imran Sadat Guest

    Hi,

    I have the following directory structure. A sample of the files is
    given below.


    Home/
    submit.do
    home.html
    Home/xslt
    tranform1.xsl


    Home/css
    transform1.css
    style.css


    Home/js
    myjs.js


    Home/jsp
    xslout.jsp


    Now what happens is when a person chooses something on the home.html
    page, a request is passed to submit.do. The result of submit.do is a
    redirection to xslout.jsp which is in the Home/jsp folder. This jsp
    returns an xml. This xml refers to transform1.xsl for transformation.
    This xsl includes the javascript using the code in the head section
    of
    the output html:
    <script type="text/javascript" src="../js/myjs.js"></script>


    On some computers the request sent by IE to the server is for a file
    js/myjs.js


    while on others it is correctly sent as
    Home/js/myjs.js


    This is really weird because on the 8 computers I tried this, 4 sent
    the correct request and 4 did not.


    Has anyone encountered this problem before?


    I know I can get the page to work by changing the src to src="/Home/
    js/
    myjs.js" but any ideas how to get the above code to work.


    The same thing happens if I include a css in the file.


    Your help is really appreciated.


    Thanks


    Imran
     
    Imran Sadat, Jan 11, 2008
    #1
    1. Advertising

  2. Imran Sadat

    Neredbojias Guest

    Re: IE6 acting weird with relative include of js and css files having .. in the beginning

    Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 17:19:26
    GMT Imran Sadat scribed:

    > Hi,
    >
    > I have the following directory structure. A sample of the files is
    > given below.
    >
    >
    > Home/
    > submit.do
    > home.html
    > Home/xslt
    > tranform1.xsl
    >
    >
    > Home/css
    > transform1.css
    > style.css
    >
    >
    > Home/js
    > myjs.js
    >
    >
    > Home/jsp
    > xslout.jsp
    >
    >
    > Now what happens is when a person chooses something on the home.html
    > page, a request is passed to submit.do. The result of submit.do is a
    > redirection to xslout.jsp which is in the Home/jsp folder. This jsp
    > returns an xml. This xml refers to transform1.xsl for transformation.
    > This xsl includes the javascript using the code in the head section
    > of
    > the output html:
    > <script type="text/javascript" src="../js/myjs.js"></script>
    >
    >
    > On some computers the request sent by IE to the server is for a file
    > js/myjs.js
    >
    >
    > while on others it is correctly sent as
    > Home/js/myjs.js
    >
    >
    > This is really weird because on the 8 computers I tried this, 4 sent
    > the correct request and 4 did not.
    >
    >
    > Has anyone encountered this problem before?
    >
    >
    > I know I can get the page to work by changing the src to src="/Home/
    > js/
    > myjs.js" but any ideas how to get the above code to work.
    >
    >
    > The same thing happens if I include a css in the file.
    >
    >
    > Your help is really appreciated.


    According to what you've shown, the correct address is
    src="js/myjs.js"

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 11, 2008
    #2
    1. Advertising

  3. Imran Sadat

    Imran Guest

    Re: IE6 acting weird with relative include of js and css files having.. in the beginning

    Wouldn't that access

    Home/xslt/js/myjs.js since the link would be relative to xslt folder.

    Regards
    Imran

    On Jan 11, 11:02 am, Neredbojias <> wrote:
    > Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 17:19:26
    > GMT Imran Sadat scribed:
    >
    >
    >
    >
    >
    > > Hi,

    >
    > > I have the following directory structure. A sample of the files is
    > > given below.

    >
    > > Home/
    > >         submit.do
    > >         home.html
    > > Home/xslt
    > >          tranform1.xsl

    >
    > > Home/css
    > >          transform1.css
    > >          style.css

    >
    > > Home/js
    > >          myjs.js

    >
    > > Home/jsp
    > >           xslout.jsp

    >
    > > Now what happens is when a person chooses something on the home.html
    > > page, a request is passed to submit.do. The result of submit.do is a
    > > redirection to xslout.jsp which is in the Home/jsp folder. This jsp
    > > returns an xml. This xml refers to transform1.xsl for transformation.
    > > This xsl includes the javascript using the code in the head section
    > > of
    > > the output html:
    > > <script type="text/javascript" src="../js/myjs.js"></script>

    >
    > > On some computers the request sent by IE to the server is for a file
    > > js/myjs.js

    >
    > > while on others it is correctly sent as
    > > Home/js/myjs.js

    >
    > > This is really weird because on the 8 computers I tried this, 4 sent
    > > the correct request and 4 did not.

    >
    > > Has anyone encountered this problem before?

    >
    > > I know I can get the page to work by changing the src to src="/Home/
    > > js/
    > > myjs.js" but any ideas how to get the above code to work.

    >
    > > The same thing happens if I include a css in the file.

    >
    > > Your help is really appreciated.

    >
    > According to what you've shown, the correct address is
    > src="js/myjs.js"
    >
    > --
    > Neredbojias
    > Riches are their own reward.- Hide quoted text -
    >
    > - Show quoted text -
     
    Imran, Jan 11, 2008
    #3
  4. Imran Sadat

    Neredbojias Guest

    Re: IE6 acting weird with relative include of js and css files having .. in the beginning

    Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 18:05:30
    GMT Imran scribed:

    > Wouldn't that access
    >
    > Home/xslt/js/myjs.js since the link would be relative to xslt folder.
    >
    > Regards
    > Imran


    The line:

    <script type="text/javascript" src="js/myjs.js"></script>

    isn't executed until home.html is on the client computer. Therefore it
    has to be relative to the location of home.html.

    > On Jan 11, 11:02 am, Neredbojias <> wrote:
    >> Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008

    17:19:26
    >> GMT Imran Sadat scribed:
    >>
    >>
    >>
    >>
    >>
    >> > Hi,

    >>
    >> > I have the following directory structure. A sample of the files is
    >> > given below.

    >>
    >> > Home/
    >> >         submit.do
    >> >         home.html
    >> > Home/xslt
    >> >          tranform1.xsl

    >>
    >> > Home/css
    >> >          transform1.css
    >> >          style.css

    >>
    >> > Home/js
    >> >          myjs.js

    >>
    >> > Home/jsp
    >> >           xslout.jsp

    >>
    >> > Now what happens is when a person chooses something on the home.html
    >> > page, a request is passed to submit.do. The result of submit.do is a
    >> > redirection to xslout.jsp which is in the Home/jsp folder. This jsp
    >> > returns an xml. This xml refers to transform1.xsl for

    transformation.
    >> > This xsl includes the javascript using the code in the head section
    >> > of
    >> > the output html:
    >> > <script type="text/javascript" src="../js/myjs.js"></script>

    >>
    >> > On some computers the request sent by IE to the server is for a file
    >> > js/myjs.js

    >>
    >> > while on others it is correctly sent as
    >> > Home/js/myjs.js

    >>
    >> > This is really weird because on the 8 computers I tried this, 4 sent
    >> > the correct request and 4 did not.

    >>
    >> > Has anyone encountered this problem before?

    >>
    >> > I know I can get the page to work by changing the src to src="/Home/
    >> > js/
    >> > myjs.js" but any ideas how to get the above code to work.

    >>
    >> > The same thing happens if I include a css in the file.

    >>
    >> > Your help is really appreciated.

    >>
    >> According to what you've shown, the correct address is
    >> src="js/myjs.js"
    >>
    >> --
    >> Neredbojias
    >> Riches are their own reward.- Hide quoted text -
    >>
    >> - Show quoted text -

    >




    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 11, 2008
    #4
  5. Imran Sadat

    Imran Guest

    Re: IE6 acting weird with relative include of js and css files having.. in the beginning

    The home.html does not include the js. It is the xslt page that has
    the script tag. So it should be relative to that. As I said it works
    on many PCs and doesn't work on some. So if the script tag was wrong,
    it wouldn't work anywhere...wouldn't you agree?


    On Jan 11, 11:10 am, Neredbojias <> wrote:
    > Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 18:05:30
    > GMT Imran scribed:
    >
    > > Wouldn't that access

    >
    > > Home/xslt/js/myjs.js since the link would be relative to xslt folder.

    >
    > > Regards
    > > Imran

    >
    > The line:
    >
    > <script type="text/javascript" src="js/myjs.js"></script>
    >
    > isn't executed until home.html is on the client computer.  Therefore it
    > has to be relative to the location of home.html.
    >
    >
    >
    >
    >
    >
    >
    > > On Jan 11, 11:02 am, Neredbojias <> wrote:
    > >> Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008

    > 17:19:26
    > >> GMT Imran Sadat scribed:

    >
    > >> > Hi,

    >
    > >> > I have the following directory structure. A sample of the files is
    > >> > given below.

    >
    > >> > Home/
    > >> >         submit.do
    > >> >         home.html
    > >> > Home/xslt
    > >> >          tranform1.xsl

    >
    > >> > Home/css
    > >> >          transform1.css
    > >> >          style.css

    >
    > >> > Home/js
    > >> >          myjs.js

    >
    > >> > Home/jsp
    > >> >           xslout.jsp

    >
    > >> > Now what happens is when a person chooses something on the home.html
    > >> > page, a request is passed to submit.do. The result of submit.do is a
    > >> > redirection to xslout.jsp which is in the Home/jsp folder. This jsp
    > >> > returns an xml. This xml refers to transform1.xsl for

    > transformation.
    > >> > This xsl includes the javascript using the code in the head section
    > >> > of
    > >> > the output html:
    > >> > <script type="text/javascript" src="../js/myjs.js"></script>

    >
    > >> > On some computers the request sent by IE to the server is for a file
    > >> > js/myjs.js

    >
    > >> > while on others it is correctly sent as
    > >> > Home/js/myjs.js

    >
    > >> > This is really weird because on the 8 computers I tried this, 4 sent
    > >> > the correct request and 4 did not.

    >
    > >> > Has anyone encountered this problem before?

    >
    > >> > I know I can get the page to work by changing the src to src="/Home/
    > >> > js/
    > >> > myjs.js" but any ideas how to get the above code to work.

    >
    > >> > The same thing happens if I include a css in the file.

    >
    > >> > Your help is really appreciated.

    >
    > >> According to what you've shown, the correct address is
    > >> src="js/myjs.js"

    >
    > >> --
    > >> Neredbojias
    > >> Riches are their own reward.- Hide quoted text -

    >
    > >> - Show quoted text -

    >
    > --
    > Neredbojias
    > Riches are their own reward.- Hide quoted text -
    >
    > - Show quoted text -
     
    Imran, Jan 11, 2008
    #5
    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. David
    Replies:
    5
    Views:
    389
    Juan T. Llibre
    Apr 21, 2005
  2. Jeff Epler
    Replies:
    0
    Views:
    510
    Jeff Epler
    Aug 20, 2004
  3. Jeff Epler
    Replies:
    0
    Views:
    459
    Jeff Epler
    Aug 23, 2004
  4. Gabriel B.

    scope acting weird

    Gabriel B., May 1, 2005, in forum: Python
    Replies:
    1
    Views:
    403
    Mike Meyer
    May 1, 2005
  5. Jesse B.
    Replies:
    9
    Views:
    236
    Jesse B.
    Mar 27, 2010
Loading...

Share This Page