Web Analytics Made Easy -
StatCounter conflicting javascripts - CodingForum

Announcement

Collapse
No announcement yet.

conflicting javascripts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment

      Working...
      X