Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Modded PHP Photo Album script

  1. #1
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Modded PHP Photo Album script

    Hey guys I'm currently trying to mod this PHP Photo Album script script so that I can click my menu and have my final page show in my content div. It all works separately right now, however it can't seem to work together in separate div on the same page. Here is my link to the page please look at my code (a bit messy) and please help me find a solution...

    Help...
    Last edited by jzhang1013; 09-28-2008 at 03:20 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It doesn't do anything right now, and I get this error in FF:

    Error: ajaxpage is not defined
    Source File: javascript:ajaxpage('bio.html',%20'display');
    Line: 1
    You must have the resource script(s) on or linked (via external script tags) to your page or else they will not work.

    In other words, this (from your source code):

    Code:
    <script src="ajax.js" type="text/javascript"></script>
    points to a missing file (404 not found).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    opps uploaded the file now, but still doesnt work..

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The files you are trying to load, like:

    Code:
    http://74.52.120.66/~jzhang/Test%20crap/asia.php
    http://74.52.120.66/~jzhang/Test%20crap/bio.html
    are 404 not found because they are in the parent folder.

    Even when you get this worked out, something like:

    Code:
    <li><a href="javascript:ajaxpage('../asia.php', 'display');">Asia</a></li>
    I can tell you that what you are trying to do, load the PHP Photo Album script, will not work. Scripts on remote pages loaded via AJAX do not run. Some scripts are fairly easily adapted to this situation, but since PHP Photo Album makes extensive use of writing to the page as the page is loading, it would need to be extensively rewritten to even have a chance of working in an AJAX environment. So you should use an iframe, possibly an object tag, or even a frameset to load in the external PHP Photo Album pages.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    hmm i guess that's really what i need to do any links to how I would be able to use an iframe code? I was really trying not to use an iframe haha..

    But for better visuals this is what I'm trying to do... this link here

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You can do that (what you have on your new demo) without AJAX, and without innerHTML. Just change the src attribute of the image tag.

    To answer your other question, to use iframe - You can put an iframe on your page and link to it, example:

    Code:
    <iframe name="display" src="some.htm" width="500" height="400" frameborder="0"></iframe>
    Code:
    <a href="someother.htm" target="display">Some Text</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks so far. the problem with the iframe is I have no control over how the content is styled inside it.. with the div I did. Since the content inside in img and not .html or .php, what can I do?

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The styles on or linked to a page displayed inside an iframe will control how it is displayed.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    the problem is that I cant link a style to an image being display within an iframe

    the only way is to take each image and turn them into an html page and insert the css, but i have hundred of images, hence the initial rejection of iframes.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The suggestion to use an iframe was for displaying a page with a script like PHP Photo Album on it as an external page. If you no longer need a script to function on the external content, if all you are doing is importing an image, what you had is fine, either AJAX, or the innerHTML thing on your second example you posted.

    I'm no longer clear about what you are trying to accomplish.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •