Results 1 to 3 of 3

Thread: Dynamic Ajax Content: Specifying DIV ID of target page in HTML markup?

  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content: Specifying DIV ID of target page in HTML markup?

    1) Script Title: Dynamic Ajax Content

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

    3) Describe problem:

    An addition to this script was added here that allows you to fetch only the content from a specific <div> on the target page, which is very useful. The DIV ID is specified in the Javascript file and not in the markup on the original HTML page.

    Is there a way of including a variable in the HTML link that specifies the DIV ID on the target page?

    Something like this:

    Code:
    <a href="javascript:ajaxpage('ExternalPage.html #SpecificDIV', 'rightcolumn'); loadobjs('Style.css');">Link1</a>
    ...where "#SpecificDIV" was the name of a specific DIV on the target page.

    This would allow there to be multiple links on the page without attaching multiple versions of the Javascript file.

    I hope I phrased that okay. I'm new to Javascript and Dynamic Drive.

    Thanks everyone for a totally awesome resource.

    Sputnik

  2. #2
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Exactly what I want to do as well.
    If javascript can call up an ID within the same page, then it should also be able to call up a specified ID on ANY external page.
    As I do not see the reason to write and load hundreds or thousands of individual pages. This is why we have anchors.

    Taking DD's own script, put all three of the cars and information into one page.
    Give each car a unique ID and call on that.

    It certainly would make life easier.

  3. #3
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This addition would make the script very powerful!
    The nice thing is the whole target page would load, not just the required <div>, so the next div that gets fetched from the same page would already be loaded! I guess this could be a disadvantage if the target page has a lot on it.

    I think it's a fairly simple thing to add. I've been thrashing away at the code, trying to get the thing working, but alas my Javascript knowledge is rather sad I guess this is a good way to learn!

    Any help from the code-guru's would be much appreciated!

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
  •