Click to See Complete Forum and Search --> : Links opening content in divs


Lyss
10-08-2006, 03:14 AM
Was wondering if there's javascript I could use to make a link (php or html content) open in a div? If not javascript then php or something else... I've been searching all day and came close, but no luck.

I used php to open content in the div but I don't know how to get a link to open the content in the div!

Does that make any sense? :)

- Lyss

Neoboffin
10-08-2006, 03:44 AM
You would need to use AJAX to display things in div tags, however you can use Iframe's which is less complicated and fussy.

http://www.w3schools.com/tags/tag_iframe.asp

Lyss
10-08-2006, 04:11 AM
I tried using ajax and it was alright until the links kept opening in another window..

Neoboffin
10-08-2006, 04:52 AM
Then you coded the ajax wrong as you need to make sure whatever the content comes back as from the call that it will update the certain <div> tag you wanted it to.

Lyss
10-08-2006, 05:25 AM
The link content opening in the div works fine now, I've put the ajax tabs in a table and I'm using images for links. Normally I put each idividual image in it's own column but if I do now the link doesn't open in a div. With all the images sitting next to eachother they have white space next to each other and I don't know how to get rid of it, any ideas? :)

Neoboffin
10-08-2006, 11:53 AM
If in your HTML code you have a space between each image, remove that space and there should be no spaces between each image then.

Lyss
10-08-2006, 10:39 PM
thanks, that helped :)

mark_yieh
10-14-2006, 12:09 AM
you can use a templating engine like smarty.

http://smarty.php.net/