Results 1 to 7 of 7

Thread: Dynamic Ajax Content script "problem" extrenal page links

  1. #1
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content script "problem" extrenal page links

    1)Name of script: Dynamic Ajax Content
    2)the url of the script is http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3)Analysis
    Sorry for opening a new thread but i couldnt find a solution using the search, although i believed that others would have the same question

    Ok i manage to load the extrenal page into the div, but now there is a problem
    is it possible to navigate with links from the extrenal page into the div(i already tried some stuff but they dont work, like changein the links )???
    Last edited by jscheuer1; 12-06-2009 at 08:48 AM. Reason: remove unintentional smiley

  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

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
    Where contentarea is the id of the target division on the 'top' page and test.htm is a page in the same folder as the 'top' page. If test.htm is in a different folder than the 'top' page, its path (absolute or relative to the 'top' page) may be included.

    Of course, as with all DD AJAX scripts, all of the pages must be on the same domain. So if using the absolute path, this will only work live, and the absolute path's domain must match the 'top' page's exactly as shown in the address bar, including whether it has the www component or not. To get around that, the network path may be used. A network path starts with / as the root of the domain. If for example your page is in the 'files' folder off of the root of the domain:

    Code:
    http://www.somedomain.com/files/test.htm
    The network path would be:

    Code:
    /files/test.htm
    This would still only work live though. It just would no longer matter about how the domain appears in the address bar, so long as the pages are actually on the same domain.
    - John
    ________________________

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

  3. #3
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you for your help but: this is not my problem
    i manage to load the pages i want into the div BUT: i want to click a link in the page i loaded and the "target" of the link would be the div... is it possible??

  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

    That's also how you would do that. Say you have a 'top' page with Dynamic Ajax Content script on it, and you use it to import a page called test.htm:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'rightcolumn');">Test</a>
    On test.htm we could have (only):

    HTML Code:
    <div>
    Hi!  I'm a Test!<br>
    <a href="javascript:ajaxpage('test2.htm', 'rightcolumn');">See Another</a>
    </div>
    As long as you have one and only one division with the id 'rightcolumn' (this should be on the 'top' page), and test.htm, test2.htm, and your 'top' page are all in the same folder, this will work.
    - John
    ________________________

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

  5. #5
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hmm ive alrady checked that... i will recheck you in case i didnt do something correctly and i will inform
    thank for your help

  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

    If you want more help, please post a link to the page on your site where you are doing this.
    - John
    ________________________

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

  7. #7
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well sorry for the late responce
    as i ve already said i had tried unsuccesfull what you suggested me
    but i found the problem, i was using php to " echo" the link and it needed /" to understand the link. without /" the link in the code appeared ok but it wasn't
    so thank for your answer problem cleared!!!

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
  •