Results 1 to 3 of 3

Thread: Ajax Tabs Content script - PDF files and use of iframes

  1. #1
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax Tabs Content script - PDF files and use of iframes

    1) Script Title: Ajax Tabs Content script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tent/index.htm

    3) Describe problem: I a trying to call an external PDF file, but all I get is a jumble of meaningless characters. Are PDF files not supported in Ajax?

    Second problem: using an iframe to embed an external page (e.g. from another domain or one with rich javascripts), the page does not display inside the iframe unless I specify the full URL (e.g. http://locahost/path/etc). However, this is a pain because it prevents portability - e.g. I am developing on my local PC using localhost and when I upload it to the server, the URL will need to be changed (and this is a problem because I will have over 20 such references).

    Any workarounds ?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Pdf are binary files that require a plugin to view, so I'm not surprised it doesn't work when fetched via Ajax, which probably just results in a garbled binary mess, similar to if you try open the file in a text editor.

    The second issue doesn't really have much to do with this script, but with the behavior of iframes in general. Unless the relative paths to the target page is exactly the same on both your local machine and web server (minus the http://localhost/ and http://www.mysite.com/) part, you'll need to use an absolute URL to make it work.

  3. #3
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the reply about PDF. However, my point with the iframes is that it does not work unless I specify an absolute path. Relative paths are not working. My local site is a complete mirror of the server. The page with the iframe works if I open it independently of Ajax, which suggests that it is not an error in my code but ajax that is breaking the iframe code.

    From your reply, it seems that this shouldn't happen. Hence, any idea why it is breaking?

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
  •