Forums

Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:

  • yui-support - replaces the `YUI 3.x` and `YUI 3 Gallery` forums.
    We have created the following discussion categories within this group to aid discoverability for these most-used topics:
    • Charts for YUI Charts support.
    • DataTable for YUI DataTable support.
    • Gallery for YUI Gallery support, including support for published Gallery components as well as the Gallery process in general.
    • Tools for support of YUI’s suite of developer tools such as selleck, shifter, grover, yogi, etc.
    • Everything Else for questions that don’t fit one of the categories above, we’ve got you covered here.
  • yui-deprecated - replaces the `YUI 2.x` forum and the forums of other deprecated products (`YUI Doc`, `Builder`, `YUI PHP Loader`, etc.).
  [ 3 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic

Walter Rumsby

YUI Contributor

  • Username: wrumsby
  • Joined: Tue Feb 10, 2009 1:11 pm
  • Posts: 20
  • Location: Auckland, New Zealand
  • Twitter: wrumsby
  • GitHub: wrumsby
  • Gists: wrumsby
  • Offline
  • Profile
Tags:
  • port
  • relative
  • base

Dealing with Resources Loaded Using Relative Paths

Post Posted: Sun Aug 29, 2010 3:04 pm
Because of the way we use YUI in our products we ship a distribution rather than rely on the hosted versions of the files. We also distribute our own widgets which are built on top of YUI's widgets (enforcing behavior as mandated by our UX team, etc.). A consequence of this is that we include resources like this:

Code:
<script src="/yui-2.6/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>


and things get a bit confused because Yeti is running on a different port (e.g. 8088), i.e. yahoo-dom-event.js is being served on port 80, and can't be found relative to port 8088.

What is the recommended way of dealing with this?

Reid Burke

YUI Developer

  • Username: reid
  • Joined: Mon May 11, 2009 1:02 pm
  • Posts: 28
  • Location: Sunnyvale, California
  • Twitter: reid
  • GitHub: reid
  • Gists: reid
  • IRC: reid
  • YUI Developer
  • Offline
  • Profile

Re: Dealing with Resources Loaded Using Relative Paths

Post Posted: Fri Sep 03, 2010 10:49 am
Yeti v0.1.0 won't be able to handle this out of the box. But, I'd love to help make a future version work for you.

That code snippet is using an absolute path, not a relative one. Yeti is designed to work with paths that would work if you opened your test with the file:// protocol. This includes relative paths and fully-qualified paths that start with http://.

A future version of yeti could try to route an undefined route like /yui-2.6 to /projects/your/path/here/yui-2.6. I'm hesitant to implement this, because some paths are reserved by Yeti ("/results", "/tests", "/projects", "/inc", "/dyn") and I'd hate for people to get confused by behavior that doesn't work all of the time.

The best solution would be making your tests work with file://, i.e. when opening them with `open test.html`.

I apologize for the delay in responding-- I just added this forum's RSS feed to my reader :) Thanks for your patience.

subtlegradient

  • Joined: Thu Jun 18, 2009 10:18 am
  • Posts: 1
  • Offline
  • Profile
Tags:
  • base

Re: Dealing with Resources Loaded Using Relative Paths

Post Posted: Wed Dec 08, 2010 9:20 am
You could try including a BASE tag in your HEAD.
  [ 3 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum