View Full Version : Links in ajaxed pages

05-23-2006, 06:35 AM
So I've been playing around with the last script, the AJAX Tab Content.

My question is:
Why links in ajaxed pages wont work? Is there a particular grammar to use?

05-23-2006, 06:42 AM
I mean this respectully, as English seems a second language for you, but just so you know "grammar" for code and programming is called "syntax". That will help make things more clear.

Links with that script, generally, should work.

Please post a link to the page on your site that contains the problematic script so we can check it out.

My suggestion is that you may be including a page with local links...
<a href="something.html">, and, when included on your page, those links don't go anywhere because "something.html" doesn't exist in your directory.

However, if you were to use "<a href="http://....../something.html"> including domain name (.com, etc) and http, in the INCLUDED page in the first place, this would solve the problem, most likely.

This is "relative" vs. "absolute".
Relative links are "compared to current location"
Absolute links go to EXACTLY the thing they link to.

Since the "relative" location is changing, they need to be absolute links.

If you're controlling your included pages, great.
If not, you can't change links if they are set to relative.
As such, you could either do some incredibly complex code fixing this problem (going through with code and changing each link in the included document to be absolute)
Or... you could just use iframes instead.

The ajax thing may work with iframes, but I'm not sure... would need to changes, certainly.

And.. in that case, ajax won't help you too much anyway.

Hope I'm pointing you in the right way.

05-23-2006, 06:48 AM
Define not work. I would imagine that, as an AJAX include becomes a part of the page it is viewed on, that any links on the AJAX page when viewed through a given page, would work just like any other link on that page. This would include being relative to that page's directory position (not the AJAX page's) if relative urls are used.