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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question conflicting javascripts

    This poor loser needs sleep, and some help! I have two pretty long scripts - one a drop down menu; the other a Quote of the Day script. Both begin with 'function land(ref, target)' along with some other matching code in the two scripts. Before I start trying to combine them so they don't conflict, is there any quick and dirty advice for me? Other than 'go to bed and start again in the morning?' MANY THANKS.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If the functions you mentioned are exactly identical you could delete one; otherwise, change the name of one slightly, and don't forget to alter the function calls in the script accordingly!

    It would be a great help if you could show the code how you implemented it.

    Last note: go to bed and start again in the morning...
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    USA, East Coast
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool use the search and replace command in your editor

    If you editor doesnt have one, toss it and get a real editor.

    append 'menu_' to all the drop down menu function names and append 'day_quote_' to the quote of the day function names.

    I am guessing if more then one function is the same, someone forgot what problems this causes? And I am guessing that there would be more scripts out there like this that will cause future confilcts if added.

    Appending a unique id to the front of the functions should make them not conflict.

    you could use 'a707-4123_' for that matter, but using something that makes more sense to what the functions are used for will help in maintenance. Just make sure that it 'IS' unique.

    -S. Bob


  •  

    Posting Permissions

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