views:

2357

answers:

4

Hi Everyone! First post here and I'm hoping someone can help me out. :)

I'm trying to lightbox a page containing a SWF via the nifty AJAX feature in Facebox (for jQuery). The trouble is that the paths now work relative to the main index page, not the directory that houses the flash page. Here's a directory breakdown:

./
  - index.html (loads projects/projectName/index.html)
  + js/
      + jquery/
          - facebox.js
          - jquery.js
      + swfobject/
          - swfobject.js
  + projects
      + projectName
          - index.html (works when viewed by itself with relative paths to JS)
      + swf/

Could anyone tell me if there's some way of preserving the scope of relative paths via jQuery (or any Javascript really)

Thanks!

A: 

I'm not sure I understand the question completly (do you have source code / url example).

The Base HREF tag can let you set the relative path start in your iFrame, and you should be able to use relative paths from there.

maxsilver
A: 

A bit more info might be helpful. Is the main index.html redirecting to the one under projectName, or opening it in a FRAME/IFRAME? Which one has the .facebox() call in it?

RET
A: 

Sorry for not uploading! Had to clear out some projects that can't be shown yet.

http://www.kevinsweeneydesign.com/help/

You can see here that the paths are all correct when viewing the file by itself (it just gets screwy when I try to facebox the content):

http://www.kevinsweeneydesign.com/help/projects/propod/

The facebox call is from the ./help/index.html file. It tries to load the ./help/projects/propod/index.html in the facebox call. However, ./help/projects/propod/index.html file uses JS that's located in ./help/js/swfobject/

Update: I tried setting the base tag (set it to ./projects/propod)...that worked, but only for images. I'm still tinkering with the 'base' parameter to give the SWF but to no avail...I don't see any "_ base_href" getting attached when I look at the object tag in Firebug like I did when linking to an image =/

restlessdesign
+1  A: 

You don't want to use relative paths the way that you are, which work their way back up the folder tree. Try using paths that begin at the Web root, and instead work their way down the folder tree. So instead of this:

../../images/image.gif

Or this:

./images/image.gif

You should try this:

/images/image.gif

hal10001
I know this is old, but wouldnt this have issues with Virtual directories?
burnt_hand