Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Problems pointing to files on my server

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #40901
    CameronDuthie
    Participant

    I’m having some difficulty pointing to one of my js files on my server.

    I have a pretty standard set up,

    – **index.html**
    – **js folder**
    – **css folder**

    The difficulty is i have another folder called

    – **6_toggle**

    Within this folder i have six html files named 1.html,** 2.html, etc. I need these individual files to point to a file in my js folder

    I thought it would be,

    I’ve also tried,

    But it doesn’t seem to work.

    Would anyone have any ideas on how to fix this?ix this?

    #114984
    matt_sanford
    Participant

    That last go around should have worked, is there a way we could see the directories?

    #114986
    __
    Participant

    If possible (and it usually is, unless this is for a code package you intend to distribute), I’d recommend using root-relative URLs instead:

    `/js/view.min.js?auto`

    #114994
    CameronDuthie
    Participant

    @matt_sanford Sure, here’s a [link](http://orchidaberdeen.com/ “”) to the site


    @traq
    sorry but i’m not sure what you mean.

    #114995
    Watson90
    Member

    @CameronDuthie


    @traq
    is basically saying use URL’s that are relative to the root of you website folder, so instead of linking to your js file like this;

    ../js/view.min.js?auto

    Link to it like this;

    /js/view.min.js?auto

    Without the dots before the forward slash…

    #114997
    CameronDuthie
    Participant

    @Watson90 Hey man, thanks responding but i can’t seem to see the code you’ve posted.

    #114998
    Watson90
    Member

    It’s because I put src=’path-to-file’, I don’t think it likes it when you do that.

    #114996
    Watson90
    Member

    @CameronDuthie – whis is the script path ending in ‘?auto’ shouldn’t it just be ‘view.min.js’?

    #115000
    CameronDuthie
    Participant

    @Watson90 It can be both. It’s a jQuery plugin developed by [Rogie King](http://finegoodsmarket.com/view/ “”) and it says the quickest and simplest way to get it up and running is to add it with the ?auto at the end.

    Just tried it without the dots and still nothing.

    Am i right in thinking i need to reference this script in my index.html and in each html file in my 6_toggle folder?

    #115046
    CameronDuthie
    Participant

    This is the latest.

    It works perfectly [here](http://orchidaberdeen.com/6_toggle/1.html “”),

    But once it get’s pulled into the [index.html](http://orchidaberdeen.com/ “”) it doesn’t want to work.

    So strange and i’m officially out of ideas…

    #115049
    pmac627
    Participant

    How does it get “pulled into the index.html” ?

    #115051
    Paulie_D
    Member

    …and what is it supposed to do?

    #115053
    CameronDuthie
    Participant

    @pmac627 The files in the _6_toggle_ folder get pulled through by jQuery.


    @Paulie_D
    It’s supposed display as a lightbox effect there’s an example of it [here](http://finegoodsmarket.com/view/ “”)

    And it works perfectly in their individual files, http://orchidaberdeen.com/6_toggle/1.html

    but when the 1.html, 2.html, etc get called through into index.html it doesn’t want to work.

    It get’s pulled through for the gallery section, http://orchidaberdeen.com/#gallery

    any thoughts or suggestions would be greatly appreciated.

    #115054
    Paulie_D
    Member

    Then I’m forced to think that the way you are bringing in the content it is fundamentally inconsistent with what the JS actually does.

    Of course, I know nothing of JS.

    #115055
    pmac627
    Participant

    Would pulling the files via jQuery trigger the browser to request the js files at all? I don’t know enough about jQuery ajax calls to know. However, if it is requesting the js files when you use jQuery to request the 1.html, I would guess it is then looking for the JS file relative to where you pulled the file to, not from where the file actually sits. Try absolute links to the js files.

Viewing 15 posts - 1 through 15 (of 19 total)
  • The forum ‘Other’ is closed to new topics and replies.