Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Can 1 Script interfere with another?

  1. #1
    Join Date
    Apr 2010
    Location
    Canada, mainly in front of the computer cursing at this random Jargon @#$%!!!!!
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Can 1 Script interfere with another?

    1) Script Title:
    Static logo & Smooth menu

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex4/logo.htm
    http://www.dynamicdrive.com/dynamici...smoothmenu.htm

    3) Describe problem:

    Hi, originally I had both of these scripts working on one page. However to make the menu easy to edit on each page I used the external file and had it fetched with Ajax

    Since I have changed this I am unable to get the Static logo to appear on my web page, all I get is the X the link works but the image is not visible

    I was wondering if changing the way I used the menu script could interfere with the static logo?

    The logo code was untouched

    If you want to see the website (or look at the code) where i am trying to use this on it is located here http://www.sammacha.com/Home/index.html

    If someone could give me a clue as to what to do to solve the problem i would really appreciate it as I am VERY NEW to this

    thank you

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I am not sure about these two specific scripts, but I see that no one has yet replied to this. In general, yes, two scripts can conflict with each other and there are two main reasons (both fixable, though it can be difficult to work through the details sometimes).

    1. Naming conflicts-- some variable, function or other entity shares a name between the two scripts and that causes conflicts of reference. It's easy to fix if you can find all of the instances of the name that is the problem. This is by far the most common problem with having two scripts on one page, or at least if you are trying to run two of the same script.

    2. Conflict of resources: one script requires a certain setting and the other script requires a different setting, or both scripts must operate within the same area, such as calling both from the body tag's "onload" parameter. It's usually possible to fix this as well with careful reworking and reordering of the conflict aspects but it's much harder to diagnose without a lot of experience. Of course sometimes you'll find it's easy if you experience a javascript error on the page.


    The way to test if there is a conflict is to remove both then add one and see if it works; remove it, add the other; finally put them both back. If everything works except when they're together, there's a conflict. But first be sure you aren't missing something like adding some property for BOTH scripts to a certain tag (such as the body tag's onload parameter mentioned above). It is possible you forgot to do the same step for both if you already did it for one (like initiating both onload or setting a CSS class that applies to the elements, etc).

    If you find there is a conflict, you can try to troubleshoot by just reordering the scripts (try script A first, then add B, and if that doesn't work try the other order, including the code order-- this can matter in some rare cases, so try having script A actually above script B in the code, then reverse it).

    Finally, someone may be able to help you figure out what is wrong, though because of the amount of code going into the two scripts it may take a lot of time/dedication to figure out what is wrong, so it might be hard to find someone who is available and familiar with the scripts. Good luck.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    Sammacha (04-12-2010)

  4. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Your image as configured and highlighted here in the staticlogo.js script:

    Code:
    //** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
    //** Available/ usage terms at http://www.dynamicdrive.com
    //** v2.0 (April 19th, 09')
    
    
    var ddsitelogo={
    	setting: {orientation:4, visibleduration:0, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec or 0, fadedurations=millisecs
    	offsets: {x:10, y:10},//offset of logo relative to window corner
    	logoHTML: '<a href="http://www.sammacha.com/" title="Sammacha.com"><img src="http://www.sammacha.com/home/dontlook/Lim-icon.gif" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"
    is a 404 not found. As far as I can tell, that's the only problem, at least as regards these two scripts.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #4
    Join Date
    Apr 2010
    Location
    Canada, mainly in front of the computer cursing at this random Jargon @#$%!!!!!
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    Thank you djr33 (Daniel) for your explanation of what I can try to do to solve this issue.
    I will definantly look into that and try to figure it out.

    and thanks jscheuer1(John)
    although I'm not sure if thats the issue here as the logo works perfectly until I use Ajax to fetch the menu form the external file, for some reason after that its an error and no longer able to locate it >.<

    I discovered it also interferes with the color selector script :/

  6. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you doubt it, click on the link:

    http://www.sammacha.com/home/dontlook/Lim-icon.gif

    It's a 404 not found.

    In fact, so is:

    http://www.sammacha.com/home/

    It should be:

    Code:
    http://www.sammacha.com/Home/
    So who knows where the image really is?
    Last edited by jscheuer1; 04-12-2010 at 03:36 AM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Sammacha (04-12-2010)

  8. #6
    Join Date
    Apr 2010
    Location
    Canada, mainly in front of the computer cursing at this random Jargon @#$%!!!!!
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    O that is very strange, becasue it worked just fine before and it still work here @_@

    http://www.sammacha.com/Home/commiss...tor/index.html

    hmm well that did help, thanks so much
    just wondering, do you know why it worked before? and why it works on teh above link?
    I feel pretty dumb but, o well
    and thank you
    Last edited by Sammacha; 04-12-2010 at 05:03 AM.

  9. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    They are two different image files in two different locations. So, the one path:

    Code:
    http://www.sammacha.com/gallery/dontlook/Lim-icon.gif
    was correct, while the other:

    Code:
    http://www.sammacha.com/Home/dontlook/Lim-icon.gif
    needed (at least) to be corrected for upper/lower case agreement.

    You would actually be better off, since (unless I missed a subtle difference) it is just the same image anyway, pointing both to the same image. Just use the absolute path.

    As to why, I'm not certain. Usually it's because in local testing the upper/lower case of the path and filename almost never matter, and on the web they almost always do.

    But there are so many other things that can happen, from simple typos to more complex issues, that it's hard to say with any real certainty.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #8
    Join Date
    Apr 2010
    Location
    Canada, mainly in front of the computer cursing at this random Jargon @#$%!!!!!
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    They are two different image files in two different locations. So, the one path:


    You would actually be better off, since (unless I missed a subtle difference) it is just the same image anyway, pointing both to the same image. Just use the absolute path.
    no they are the same and thats very true. I have actually been meaning to do that for some time now... thanks for the reminder


    Quote Originally Posted by jscheuer1 View Post
    As to why, I'm not certain. Usually it's because in local testing the upper/lower case of the path and filename almost never matter, and on the web they almost always do.

    But there are so many other things that can happen, from simple typos to more complex issues, that it's hard to say with any real certainty.
    It used to work perfectly when it was actually on the web but who knows. Also thanks. I know this takes up your time and this info is very useful to stupid old me who randomly decieded that I could make and run my own website :/

  11. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, this is a fairly easy one because I don't have to know the precise answer. I don't think anyone really can, it's something that happened before. So we can't be sure of the original circumstances, only of the current solution.

    Remember though I said (emphasis added):

    in local testing the upper/lower case of the path and filename almost never matter, and on the web they almost always do.
    These things do vary. On the local machine, it depends upon the OS. But most local machines are case insensitive as far as paths and filenames go. On the web it depends upon the server configuration. I have seen at least two servers where the upper and lower case filenames and paths were treated as identical. This led in one case to confusion over the actual names of the files though when tested via javascript as to the href attribute of a given link. Since the web author wasn't constrained by their server to use the correct case, they had a mixture in various places. It all worked for navigation. But in javascript which is case sensitive in most respects, unless steps are taken to make it ignore case, the href was being misinterpreted as not matching, when it really "did" (sort of).

    That's not what happened here, but perhaps something similar did. And/or you later changed servers or your server changed its settings as regards case.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  12. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Sammacha (04-15-2010)

  13. #10
    Join Date
    Apr 2010
    Location
    Canada, mainly in front of the computer cursing at this random Jargon @#$%!!!!!
    Posts
    15
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    well thats good enough of rme
    thanks again john

Bookmarks

Posting Permissions

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