Logged Out
Create an Account
Login:
Password:

Forgot your password?
reload the content of a div?

reload the content of a div?
[Back to Index]  [Bottom of Thread]
Thread Tags
Primary: [Advanced Layout]
Secondary: None
Well... I am by no means a programmer or web designer, so I figure before I start smashing my head against the desk because I have yet to find a solution... I'll ask the good folks here

Is there a way to have the content in a div "reloaded" when it is "shown" do to a Jscript link changing the display property of a div from hidden to show?

For example, hit up Krush ( http://krush.dkpsystem.com ) and click on the links in the fixed menu on the bottom of the screen.
[The SHOUT! box link would probably suit best for the example]

When the page is loaded (or refreshed) it will update the content in the shot box div, but I would like to be able to click the link at any point and have the div content updated so I don't have to refresh the entire site to see if someone has posted a shout.

If anyone has any better ideas on how to acheive what I currently have written on the site, I'm also very open to suggestions

Thanks all!

--
Genius may have its limitations, but stupidity is not thus handicapped.
- Elbert Hubbard (1856 - 1915)
What you're looking for here is called ajax, and it's not exactly a trivial thing. You could do it, and parse stuff with javascript, but it's actually a pretty daunting task for someone not too well versed in javascript.


The trick would be to load the main site with an ajax call (our easy ajax call is the "engine()" function in the dkpsystem.js file, which takes a callback function as the first parameter and the URL as the second), then parse the resulting HTML for the sections you need (shoutbox, vent info, whatever)

It's definitely not a straightforward task, since callback functions are a bit of an advanced topic, but it is doable.

--
It's all in the reflexes.
Hey there Chops;

Thanks for the answer, I was sure it wouldn't be an easy task

I guess this is a little (well more like A LOT lol) out of my league, I'll just have to let people know that if they want to see an updated shout box they will have to refresh the site, then open the div again.

Kind of an odd question, however, if this callback would require a URL, how would you pass it in? the shoutbox itself is populated by php is it not? (the shoutbox is your that comment code that gets translated if I understand correctly) so there is no URL specific to the shoutbox, I would wager a guess that you would pull whatever URL is currently active, use this ajax stuff to "load" the page, but use javasript to filter out and only render the shoutbox coding so the shoutbox gets reloaded but the rest of the site essentially gets ignored during the call?

More just a question of mechanics, if I'm right a yes will do, if I'm totally off base, then just say no.

It looks like my thoughts on what I want to do (which is exactly why I went with your service due to the level of access you allow us to have) requires a very large investment in time and education on my part to teach myself all this new web stuff.
The last time I was actually learning stuff for the web it was pretty much just HTML lol .

--
Genius may have its limitations, but stupidity is not thus handicapped.
- Elbert Hubbard (1856 - 1915)
Hello again!

Perhaps this is a much simpler question...

The main navigation of my site is setup through hiding and showing separate <div>s, is there a simple way to only show one div at a time?

IE: fresh load of site, the sub menu section is blank as it is now, when the "main menu" link is clicked it shows that <div>, and when a new menu link is clicked, it hides the other <div> sections and only shows the one that was just activated?

I have tried modifying the Jscript that hides and shows the <div>s currently, but all I managed to do was break it lol.

--
Genius may have its limitations, but stupidity is not thus handicapped.
- Elbert Hubbard (1856 - 1915)


[Back to Index]  [Top of Thread]