PDA

View Full Version : Resolved Dynamic Ajax Content script "problem" extrenal page links



giannis
12-06-2009, 01:14 AM
1)Name of script: Dynamic Ajax Content
2)the url of the script is http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

3)Analysis
Sorry for opening a new thread but i couldnt find a solution using the search, although i believed that others would have the same question

Ok i manage to load the extrenal page into the div, but now there is a problem
is it possible to navigate with links from the extrenal page into the div(i already tried some stuff but they dont work, like changein the links )???

jscheuer1
12-06-2009, 09:02 AM
<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>

Where contentarea is the id of the target division on the 'top' page and test.htm is a page in the same folder as the 'top' page. If test.htm is in a different folder than the 'top' page, its path (absolute or relative to the 'top' page) may be included.

Of course, as with all DD AJAX scripts, all of the pages must be on the same domain. So if using the absolute path, this will only work live, and the absolute path's domain must match the 'top' page's exactly as shown in the address bar, including whether it has the www component or not. To get around that, the network path may be used. A network path starts with / as the root of the domain. If for example your page is in the 'files' folder off of the root of the domain:


http://www.somedomain.com/files/test.htm

The network path would be:


/files/test.htm

This would still only work live though. It just would no longer matter about how the domain appears in the address bar, so long as the pages are actually on the same domain.

giannis
12-06-2009, 02:55 PM
thank you for your help but: this is not my problem
i manage to load the pages i want into the div BUT: i want to click a link in the page i loaded and the "target" of the link would be the div... is it possible??

jscheuer1
12-06-2009, 04:38 PM
That's also how you would do that. Say you have a 'top' page with Dynamic Ajax Content script on it, and you use it to import a page called test.htm:


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

On test.htm we could have (only):


<div>
Hi! I'm a Test!<br>
<a href="javascript:ajaxpage('test2.htm', 'rightcolumn');">See Another</a>
</div>

As long as you have one and only one division with the id 'rightcolumn' (this should be on the 'top' page), and test.htm, test2.htm, and your 'top' page are all in the same folder, this will work.

giannis
12-06-2009, 04:47 PM
hmm ive alrady checked that... i will recheck you in case i didnt do something correctly and i will inform
thank for your help

jscheuer1
12-06-2009, 05:17 PM
If you want more help, please post a link to the page on your site where you are doing this.

giannis
12-17-2009, 05:24 PM
well sorry for the late responce
as i ve already said i had tried unsuccesfull what you suggested me
but i found the problem, i was using php to " echo" the link and it needed /" to understand the link. without /" the link in the code appeared ok but it wasn't
so thank for your answer problem cleared!!!