SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Ajax problem - Script Only on one page should be site-wide

    I've been trying to install a new shopping basket system to my wordpress site called Easy Basket. Eventually I've managed to get it up and running on preview pages and the homepage but the basket doesn't display on any other pages!?

    Apparently Firebug relays a 404 error file can not be found when Ajax Get tries to write the basket into the page.

    Here is the coding installed into the head section

    HTML Code:
    <link rel="stylesheet" href="/easybasket/skins/default.css" type="text/css"/>
    HTML Code:
    <meta name="easybasket" content="showhide=yes" />
    <script type="text/javascript" src="/easybasket/easybasket.js"></script>
    My website is carp-fishing-reels.com Any help to get this working would be appreciated

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    You have a pathing problem.

    An example of the 404 error is for this path:
    http://carp-fishing-reels.com/bait-b...in=default.xsl
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your input Paul but I'm still baffled. Somehow missed this vital piece of code out from my first post:
    HTML Code:
    <div class="easybasket" data-url="skin=default.xsl"></div>
    This must be related to the pathing problem. I tried changing the data url to "http://carp-fishing-reels.com/easybasket/?skin=default.xsl" as this appears to be the right path and have a feeling it is to do with absolute linking, but it hasn't worked.
    Any ideas on how to fix?

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Currently the location is designated as this, from the easy basket script:

    Code:
    var location = 'easybasket/'; // The location of the easybasket folder.
    Is the solution as easy as putting a leading slash on that location?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, the solution wasn't quite that easy, but it set me off on the right lines. I had to ensure much of the backend stuff was absolute urls.

    Now everything is working fine although that is what I thought last time...


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
  •