im an Ajax [Div]
- Started
- Last post
- 11 Responses
- thejudders
I am trying to find a way to load content into a div from another div kinda like the oldskool frames method. is there an easy way to do so, I hear there is an ajax solution which will do it without a page refresh (which is ideal) but I have no idea where to start, nor have I experience with ajax implantation.
Can anyone point me in the right direction ?
- UndoUndo0
you can use javascript with
getElementByID()
- thejudders0
Looking into that now then, thanks..
Does that however preload the content before its clicked ? I only want to load up the content after the click as I will have several links with video at the other end.
- UndoUndo0
I believe its after the call to whatever you load it with, not 100% so check it out.
- thejudders0
Thanks.. its a good start. If anyone else has other ideas that wuld be great, im now reading up on getElementById.
- fusionpixel0
do you want to do it all on your own or are you open to already made solutions?
- thejudders0
As its my first attempt at this, I would be open to ready made solutions.. anything to get it done and learn for the future.. plus its a personal project. Have you got a solution in mind?
- Visia0
oh, I thought you meant that you were physically in Ajax Ontario. I was going to say that I'm sorry to hear that.
- thejudders0
Can you suggest possible solutions Fusion Pixel?
- ldww0
you should create two css stlyles
.show { display:block; }
.hide {display:none;}then put the content in the div but give it a class of hide, then just use javascript to change the class to show when you want to show it.
or you could use xmlhttprequest in javascript to load the data after on click and put it into the div with innerHTML.
you should look into prototype, it makes all this ajax stuff alot easier
- ldww0
hide said "display: none;"
- thejudders0
Thanks for that, that seems just like what im after. I would only want it to load the content to be placed in the div after the click.
Need to learn some java script i think to help me out.