Results 1 to 5 of 5

Thread: How can I keep the next/back pages in the div?

  1. #1
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How can I keep the next/back pages in the div?

    1) Script Title: Dynamic Ajax Content

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

    3) Describe problem:
    I managed to get this working beautifully on the desktop with my own HTML pages and CSS styling. However, when the page is inserted into the div on the right, and has next/back buttons coded with <a href=""> tags, then those buttons open the next or back pages in the full window.

    How can I keep the next/back pages in the div? The left div needs to be kept clear for navigation.

    Thanks!

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

    Default

    Do the links inside your Ajax loaded page also point to local pages within your domain? What you're asking is possible provided that they do, as Ajax is currently limited by the same origin domain limitation.
    DD Admin

  3. #3
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, the prev/next files referenced in the rightcolumn div are actually all in the same folder with each other.

    How should the script be changed to allow them to stay in the same rightcolumn div?

    The only alternative to this script is to put them in a table, with the navigation links as targets pointing to the right frame, and all the links in the right frame as targets to the same frame.

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

    Default

    To load a link inside one of the Ajax loaded pages once again inside the right column, you can simply edit that link's href attribute to also call the ajaxpage() function. So lets say "external.htm" is dynamically loaded via Ajax, and inside this page, you have a link to "external2.htm" that you also wish to load via Ajax in the same DIV when clicked on. That link would look something like this:

    Code:
    <img border="0" src="ajaxfiles/porschegt.jpg" width="540" height="340">
    <h3 id="cartitle" style="border-bottom: 1px solid #C0C0C0; margin-bottom: -5px">Porsche Carrera GT</h3>
    <p>The Carrera GT has a 5.7 litre V10 internal combustion engine that produces 
      605 SAE horsepower (451 kW). Porsche claims it will accelerate from 0 to 100 
      km/h (62 mph) in 3.9 seconds and has a maximum speed of 330 km/h (204 mph). 
      With 605 hp, the car weighs 1,380 kg (3,042 lb). The Carrera GT is only 
      offered with a six-speed manual transmission, in contrast to its rival the 
      Ferrari Enzo that is only offered with sequential manual transmission. Also 
      the Carrera GT is significantly less expensive than the Ferrari Enzo. The 
      Ferrari Enzo is priced around $660,000 to the Carrera GT's $440,000. The 
      Carrera GT is known for its high quality and reliability which makes it one of 
      the best supercars ever. [<a href="javascript:ajaxpage('ajaxfiles/external2.htm','rightcolumn')">source</a>]
    Just remember when specifying the path to external2.htm that it should be relative to the directory where the parent page, or external.htm, is located in. If in doubt try setting things up initially so both pages are in the same directory to verify that it works as intended first.
    DD Admin

  5. #5
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very, very much!!

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
  •