Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: dynamic ajax content

  1. #1
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dynamic ajax content

    I cannot figure out how to use the 'load external link' option in the Dynamic Ajax Content Script.

    I put this link;

    <a href="javascript:ajaxpage(siteuptime.com+'/prem_statistics.php?Id=28395&UserId=42771', 'rightcolumn');" style="text-decoration: none">

    That did not work. I also put

    <a href="javascript:ajaxpage('http://siteuptime.com/prem_statistics.php?Id=28395&UserId=42771', 'rightcolumn');" style="text-decoration: none">

    Nothing happens when the link is clicked on. Please assist. Thank you

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    whats the name of the DIV code?

  3. #3
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    taken from the site:

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

  5. #5
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Let's try this again. To quote myself

    "I cannot figure out how to use the 'load external link' option in the Dynamic Ajax Content Script."

    Taken from the site:

    <a href="javascript:ajaxpage(rootdomain+'/mydir/index.htm', 'contentarea');">test</a>
    <div id="contentarea"></div>

    I'm not 100% understanding the method above. Any help is appreciated

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

    Default

    Firstly, just to make sure you understand, the "load external link" feature refers to loading a page that's still on your own server, just that the syntax is external ("http://"). Due to security reasons Ajax doesn't let you load an offsite link (ie: yahoo.com).

    With that said, the code:

    Code:
    <a href="javascript:ajaxpage(rootdomain+'/mydir/index.htm', 'contentarea');">test</a>
    <div id="contentarea"></div>
    would mean load:

    Code:
    http://www.mysite.com/mydir/index.htm
    where "mysite.com" is your site's root domain. The reason for this wierd syntax is that your page may be accessed either with or without the "www" portion, and that matters to Ajax.

  7. #7
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for clarifying this.

    Is there any possiblity to work around this?

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Is there any possiblity to work around this?
    Yes, but it requires a server-side script, and doesn't allow for remote hosting. A server-side script can include any site, on any domain, and give its output. If you create such a script, you can include a remote file by means of it.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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

    Default

    Not sure if this is what Twey meant, but yes, it is possible, though it would require something like a proxy be set up, using PHP for example. See here for a tutorial and sample code.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by ddadmin
    it would require something like a proxy be set up, using PHP for example.
    Close enough.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •