Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    2 Calendar in 1 page!

    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..
    Attached Files Attached Files

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,917
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Quote Originally Posted by khorshidnam View Post
    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..
    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.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    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!

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,917
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Quote Originally Posted by khorshidnam View Post
    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

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •