+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    1,808

    Multiple Dynamic content not working

    I'm using multiple dynamic content in a project I'm working on and some of it isn't working. I'm using things from DynamicDrive.com and they say this if you are using more than one code:

    "If you have another script on your page that does the same, one of them will not run."

    Their solution is this:

    "The way to go about solving this conflict is simple, though not quite the same to explain. Essentially, what you want is to end up with only ONE delta for both scripts, with that delta calling the two scripts. Let's list some possible scenarios now, and their resolutions:

    EXAMPLE #1:
    SCRIPT 1: <body onload="dothis()">
    SCRIPT 2: <body onload="dothat()">
    RESOLUTION: <body onload="dothis();dothat()">

    EXAMPLE #2:
    SCRIPT 1: <body onload="dothis()">
    SCRIPT 2: window.onload=dothat()
    RESOLUTION: <body onload="dothis();dothat()">

    EXAMPLE #3:
    SCRIPT 1: window.onload=dothis
    SCRIPT 2: window.onload=dothat
    RESOLUTION: <body onload="dothis();dothat()">

    As you can see, regardless of whether the two scripts contain "delta" or "beta", the resolution is the same- remove BOTH lines, and call the scripts directly within the <body> tag, each separated by a semicolon. If you wish to combine three scripts, the procedure is the exact same.

    By using the above technique, both scripts are called and executed, as opposed to just one- or neither. In other words, conflict avoided!"

    Ok, I tried this but some items still don't seem to work. Any ideas?
    "I think there is a world market for maybe five computers." --Thomas Watson, Chairman of IBM, 1943

  2. #2
    Join Date
    Sep 2002
    Location
    Hong Kong
    Posts
    3,487
    http://www.wsabstract.com/javatutors...plejava2.shtml
    The reason why two working scripts may mysteriously not work when put together is simple- script conflict. You see, any duplication in variable declaration, function name, or event-handler access in two scripts can cause at least one, if not both scripts to become inoperative.

  3. #3
    Join Date
    Sep 2002
    Location
    MA, USA
    Posts
    4,582
    A lot depends on exactly what each function is doing.

    If one script does something the other depends on, or if both and attempting something that involves the same resources, you're asking for trouble, even if it works "sometimes".

    Out of curiosity, try this and see if it gets you anything:

    EXAMPLE #4:
    SCRIPT 1 & 2: <body onload="dothis();dothat()">
    RESOLUTION: <body onload="dothis();setTimeout('dothat()',400)">

    Lemme know what you get. It may create a situation where it works "still not at all","sometimes", "most times", or "all fixed". Whichever way, it may help.

    ~ Nexus

  4. #4
    Join Date
    Sep 2002
    Posts
    1,808
    Thanks, Nexus, I'll try that
    "I think there is a world market for maybe five computers." --Thomas Watson, Chairman of IBM, 1943

Posting Permissions

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

Sponsors

Ending Auctions

Poll

Besides domain registrations, I prefer to work with a registrar that also offers this service?
1. Hosting
2. Marketplace for buying/selling domains
3. Domain Parking
4. Free Webpage with For Sale message
5. Other
to see the Poll results!
 
DomainState.com
Domain Tools | Domain Directory | Registrar Stats | Domain Glossary | Industry Events | FAQ | Members | Terms | RSS | Link To Us | Advertise | Contact Us
Other Related Trellian Services:
Above Domain Parking Manager   |   Free Search Toolbar   |   Free Webpage Builder   |   Keyword Research   |   Search Engine Submission   |   SEO Tools
Copyright © 2002 DomainState.com a Trellian Company