Attilitus Posted January 13, 2007 Share Posted January 13, 2007 I have two ajax "Divs" on my page and would like certain content when loaded in one Div to trigger the other div to reload as well. (In order to update stats, ect.)Is this possible? Quote Link to comment Share on other sites More sharing options...
drewbee Posted January 13, 2007 Share Posted January 13, 2007 Yeah, you would simply need two different ajax calls. Part of the first routine after finishing the returned response would fire up the second call. Quote Link to comment Share on other sites More sharing options...
Attilitus Posted January 14, 2007 Author Share Posted January 14, 2007 Right... but how exactly would I go about doing that? I have no experience with javascript, so I have basically been using the engines I could find to set myself up. Quote Link to comment Share on other sites More sharing options...
Attilitus Posted January 14, 2007 Author Share Posted January 14, 2007 Sorry for the double post... (there is no edit option?)I just thought that I would add that I would prefer to do this in PHP "if possible." That is why I have been trying using location headers at the start of loaded content, ect. Regardless of the method, however, I know that I need to have a "second ajax call" I just do not know how to make a second ajax call at the same time as another without having the user click a second link. I know that there must be an easy way to do it, I am just very new and inexperienced to the world of AJAx.Thanks for any help you guys might be able to provide. Quote Link to comment Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 You would have 2 copies of your ajax code.For example: I use this in my ajax code:[code]onkeyup="sendRequest(this.value);"[/code]Basically, I would have to pick a different event.You may also have to rename your request for the reload. So in all scripts the sendRequest() and such scripts would be renamed. Considering you need no data passed through, I would narrow it down to sendRequest(). This is just a function I use, they are named similarly with most frameworks. You would want to make it be onload=sendRequest() (if it is the load of the first div that would fire it up). Otherwise you can look up javascript documentation to find what function you would want to fire up the second load. Good luck. If you need more help feel free to PM me or email mrfg2006 [at] gmail <.> [com]I don't read through these forums very often so I probably won't get another reply if you don't Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.