Page 1 of 1

change state of date

PostPosted: Tue Mar 11, 2008 11:03 pm
by johannes
Hi Chris

Your calender script seems to be excatly what I've searched for. :lol:
Yet I'm struggeling with the installation. By clicking on a certain date, the state doesn't change without reloading the page. The calendar is temporarily located on http://koba-arch.ch/holiday.
What could be the problem? Are there any special settings on the webserver requiered? :?:
For any help I thank in advance.
Johannes

Re: change state of date

PostPosted: Wed Mar 12, 2008 3:24 am
by chris
Hi there,
Thanks for the comments, I hope you can get this working ;)

I have just checked your link and, as far as I can see, it appears to be working correctly in Firefox. However, there is a problem in IE7 which is due to a small error in the date links.
Find the code :
Code: Select all
<a href="javascript:void;" onclick="ajax_mod_state( ....

and replace with this:
Code: Select all
<a href="javascript:ajax_mod_state( ....


This is an error in my zipped version which I must update ASAP - sorry about this :(

See if changing this line solves your problem.

Chris

Re: change state of date

PostPosted: Wed Mar 12, 2008 10:25 pm
by johannes
Hi Chris
Thanx for the quick reply.
Yes, I'm using IE7.
Well, the little change didn't have any effect. :( I also tried
Code: Select all
<a href="#" onClick="ajax_mod_state(...
with the same result.
When I click on the date/link I always get the same javascript error message:
system error:1072896658.

Now, the funny thing is that on your site http://www.cbolson.com/code/availability-calendar/ my browser hasn't any problem. ;) Is there any difference in the code? :?:

Re: change state of date

PostPosted: Thu Mar 13, 2008 1:33 am
by chris
OK, I can now see the problem in your version.

A google check for this error comes up results that blame it on the charset.

I must admit that this is not something that I am hot on but it appears that your server or code is not using the uft-8 charset.

Can you try adding this line:
Code: Select all
header('Content-Type: text/html; charset=utf-8');
at the beginning of the update_cal.ajax.php file (directly after the opening php tag). This should force the output to be encoded lcorrectly.

Let me know if this works :)

Chris
edit:
also try adding this header aswell/instead of the other one I mentioned:
Code: Select all
header('Content-type: text/plain");
- I might be due to this.

Re: change state of date

PostPosted: Thu Mar 13, 2008 10:07 pm
by johannes
Hi Chris

Yes, that's it:
Code: Select all
header('Content-Type: text/html; charset=utf-8');

Now, it's working fine! Thanks a lot! :D