SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How do I get links to open in same DIV?

    I am using the code from http://www.dynamicdrive.com/dynamici...jaxcontent.htm so the user can click on a nav link on the left side div and it will load, via Javascript, an external HTML page in the right-side div. All works perfectly. But I find that the back/next links of the right-side page open up in the full window, obscuring the nav links at left.

    How do I make the back/next links open only within that div, or at least on that half of the screen?

    I'd like the same external html page content to be used for both iPhone and iPad screens. I have the detection code to switch between the two devices, so I'm hoping I don't need to open every page to make a change to the links! Or if I must include it in every page, I want the iPhone version to work, letting the Javascript degrade gracefully.

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    I'm not sure what you mean by the 'back/next' links on the right-hand side ... I can't see any links like that on the demo page, so if you're talking about something you've done on your own page then you'll need to give us a link.

    Words of warning – before you get too carried away with Ajax for navigation, bear this in mind. It completely destroys the way hypertext navigation is supposed to work. Go to that demo page, click on an Ajax link, and then click the 'back' button. Do you go back to where you were before? No, because the browser doesn't recognise it as a change. Bookmark the page, or give a link to it, and you can only go to the original state of the page. Search engines can only find the home state, and may not even crawl the extra content. Right-click and open in new tab, and you just get an error message.

    The method they have used is absolutely awful for site navigation, and I would very strongly advise against using it.

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This will be used in the iPhone and iPad, and there is no bookmarking of pages.

    The next/back buttons appear on the page that is called to populate the right div. It is one of my own pages, and has no Javascript. The back/next buttons are simple <a href=""> tags.

    Thanks for answering!

  4. #4
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I will close this thread. I found out that the site from which I got the script has a forum. I'm posting my issue there.


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
  •