Results 1 to 9 of 9

Thread: Dynamic Ajax Content - URL

  1. #1
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content - URL

    Re: Dynamic Ajax Content
    http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    hi,
    is it possible to get an absolute URL for a page with new content loaded in? we need to be able to give the URLs to customers of specific pages but wouldnt want to lose the ease of use script.
    i tried variations of
    Code:
    ...rootdomain+'/mydir/index.htm', 'contentarea')
    but nothing works yet, can anyone show me how please?
    Last edited by buggy; 01-18-2006 at 11:58 AM.

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

    Default

    Well firstly, are both the page and the external page referenced by the Ajax script on the same domain? This is required due to security limitations with Ajax. In this case, rootdomain should correctly give you the host name for both the page and external page.

  3. #3
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    that isnt my issue, if someone types in the url for a page in the site they will only ever get the first page as you cant bookmark pages using ajax. this is causing me problems, if i cant find a way to have a url for any page then i'll have to rewrite it

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

    Default

    Well, the whole reason for using Ajax in the first place is to load an external page into the current, so the current page never changes, only the content inside it. Bookmarking can only occur if a page is loaded on its own in the browser, which is the opposite of Ajax. Or maybe I misunderstood your question?

  5. #5
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I would like to know the answer to the question posted as well. Practically, I can see somone using a flash menu and using ajax to load content into the webpage while never needing to reload the flash component for every page. (www.dimmibar.com)

    I'm wondernig if there is a way to specify the contents of the dynamic container via url.

    Anyone?

  6. #6
    Join Date
    Mar 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have the same question as above:

    Does anyone know how to use a tag such as this;

    <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>

    from a flash button?

    The flash program doesn't appear to allow this syntax

    I had all animated GIF (w/image maps) instead of SWF and everytime I pressed a button all animation would freeze.

    Any replies would be greatly appreciated

  7. #7
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    did this ever get resolved? I'd love to hear the solution.

  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

    see:

    http://www.dynamicdrive.com/forums/s...ad.php?t=12105

    Therein is a solution for doing this with AJAX tabs, a similar routine could be worked out for this. The 'foreign' URL would have appended to it a query string that would tell the AJAX script what to load. That way it would be the page on the same domain as the script and the content pages that would be doing the loading.
    Last edited by jscheuer1; 08-15-2006 at 05:18 AM.
    - John
    ________________________

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

  9. #9
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Vagrant asked about the ActionScript syntax for an AJAX content loading application, so here you go:

    actionscript:

    on (release) {
    getURL("javascript:loadXMLDoc('content.php')");
    }

    ajax:

    function loadXMLDoc(url)
    {
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET",url,false);
    xmlhttp.send(null);
    document.getElementById('divname').innerHTML=xmlhttp.responseText;
    }


    Hope that helps, it works great on my site!

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
  •