PDA

View Full Version : Dynamic Ajax Content - URL



buggy
01-18-2006, 11:38 AM
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

...rootdomain+'/mydir/index.htm', 'contentarea')
but nothing works yet, can anyone show me how please?

ddadmin
01-18-2006, 09:23 PM
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.

buggy
01-19-2006, 11:13 AM
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 :(

ddadmin
01-20-2006, 12:11 AM
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?

3pointapex
01-26-2006, 07:55 PM
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?

vagrant
03-06-2006, 07:06 AM
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

LifeIsBeta
08-15-2006, 02:06 AM
did this ever get resolved? I'd love to hear the solution.

jscheuer1
08-15-2006, 02:35 AM
see:

http://www.dynamicdrive.com/forums/showthread.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.

TrapsCreato
02-20-2010, 08:18 PM
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!:)