Jump to content

AJAX calendar


jimfog

Recommended Posts

It seems that if i want to make a calendar that has the responsiveness of(for example) Google calendar it must be based in Ajax. When i say responsiveness i mean it does not need refresh to go from one date to the other. So, it seems that purely PHP will not suffice. Nonetheless i must store events in the database-how am i going to do that, with ajax calls? In such a scenario as the above, i am wondering, since we are talking about info based on the date, am i going to use solely the js date object or do i have to use at some extent the php date function also? I do not know, if an ajax based calendar can support the functionality of a PHP calendar? The whole issue arised in my mind because i've noticed, that in a PHP calendar, when going from one date to the other, a refresh is needed. Thanks.

Link to comment
Share on other sites

In my understanding a schedule which shows data that comes from MySQL or XML, done in php, you need to refresh the page.SevocĂȘ using Jquery / Ajax then refresh this page to the next date for example, happens inside the DIV containing the calendar data.An example, I think, equal to what you need is the layout with Ajax, which maintains the structure and run the php to bring new data to HTML div that mosrar.There are several jQuery plugins that do this. The Jquery Ajax also has a function, and remember that jQuery is the front end, it performs tasks such as php, but not for the Back-end, I guess ~ and you have advanced knowledge and already knows that.

Link to comment
Share on other sites

If I were you, I would concentrate getting the php calendar version to work even though the page would have to reload everytime, then work on implementing it to work through ajax, which should be basically using the call same php code to update the calendar without refreshing, that way it would work with OR without JavaScript enabled. You would use javascript to prevent the php only solution running and and initiate ajax solution instead when js enabled.

Link to comment
Share on other sites

If I were you, I would concentrate getting the php calendar version to work even though the page would have to reload everytime, then work on implementing it to work through ajax, which should be basically using the call same php code to update the calendar without refreshing, that way it would work with OR without JavaScript enabled. You would use javascript to prevent the php only solution running and and initiate ajax solution instead when js enabled.
I agree with your approach, i have already proceed enough in making a functional php calendar. One question. Tell me please. Making the php calendar work with ajax, does this mean that i have to delete php code(date functions etc...) i have already written? I hope the answer is no, cause it would be a waste of the effort. So much PHP code would be useless which I hope, is not the case. P S.I saw that google calendar and hotmail calendar rely on ajax, i wonder, why they did not make the calendars work also solely in PHP. Because if you disable js, tha calendars(hotmail and google) do not even appear in the browser. See it for yourself also
Link to comment
Share on other sites

One question. Tell me please. Making the php calendar work with ajax, does this mean that i have to delete php code(date functions etc...) i have already written?

You should be able to use most of the php code, for the javascript to php ajax solution, so it won't be usless both would be used in both methods. To be honest I don't use Google calendar, and I thought you would be using a ajax based calender, but you were convinced to go php route, which I thought you would known from the start that a total reload of page would be required using this method, and since you have probably completed the total php version, I suggest to you to use both for JavaScript enabled and disabled scenario. I imagine with google map you are therefore stuck with only one option, you must have js enabled to use, which you to could have used with a warning message "Javascript Must be enabled to proceed" if user js is disabled.

Link to comment
Share on other sites

About the reload issue it had not crossed my mind-unfortunately. It is good to know i do not have to ditch the php code. Now, the php code works with requests sent by the URL(GET method)-in order to move from one date to the other. When I deploy AJAX, are the calls going to be hidden?Meaning, no variable will be sent from the URL? Just asking for informative reasons.

Link to comment
Share on other sites

You would usually send the same querystring to retrieve the selected date through JavaScript onclick event to a php file, it would process this data and then return the result to a element container with specific id ref. You can use javascript to loop through all anchor href to replace url and querystring with href="javascript: void(0);" this will prevent triggering a reload of the page. ajax example http://w3schools.com/ajax/ajax_database.asp

Link to comment
Share on other sites

Thanks for info. Anything now "is in place".

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...