PDA

View Full Version : 2 Calendar in 1 page!



khorshidnam
Aug 4th, 2012, 01:30 PM
I want to have 2 Calendars in one HTML page..
one of them gregorian and the other persian (Jalali)
I have both of them in seperate pages and both of them work fine! but when i put them together in one page, one of them gets crashed..
i attached my files..
I really need help guys..
:confused:

Philip M
Aug 4th, 2012, 04:43 PM
I want to have 2 Calendars in one HTML page..
one of them gregorian and the other persian (Jalali)
I have both of them in seperate pages and both of them work fine! but when i put them together in one page, one of them gets crashed..
i attached my files..
I really need help guys..
:confused:

Well, that is bound to happen if there is any duplication of function and/or variable names between the scripts. The second will overwrite the first.


In theory, there isn't any difference between the theory and practice. In practice, there is.

khorshidnam
Aug 4th, 2012, 06:37 PM
Well, that is bound to happen if there is any duplication of function and/or variable names between the scripts. The second will overwrite the first.


In theory, there isn't any difference between the theory and practice. In practice, there is.

So, ur saying that there is no way to put 2 scripts in 1 page?
Im sure that it can happen but HOW! i wonder..
what if I name the scripts and call them or put 2 scripts in 1 scripts..
There must be a way!

Philip M
Aug 4th, 2012, 07:36 PM
So, ur saying that there is no way to put 2 scripts in 1 page?
Im sure that it can happen but HOW! i wonder..
what if I name the scripts and call them or put 2 scripts in 1 scripts..
There must be a way!

Of course you can put two scripts into one page. But there must be no duplication of function and/or variable names. If the second script is essentially a copy of the first (but in a different language) you must change all the names of the functions and variables in the second script - the simplest way is to add a B suffix.

e.g. function doThis() { // first script
function doThisB() { // second script

for (var i =0 ..... // first script
for (var iB = 0...... // second script