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

Thread: Dynamic Ajax Content and Javascript

  1. #1
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content and Javascript

    Dynamic Ajax Content and Javascript

    2) http://www.dynamicdrive.com/dynamici...jaxcontent.htm


    3) I cant seem to get the javascript to work. I have tried the 'PollC' that I had read about, but that seems to just bring up the scroll on its own. The content page to be loaded works fine on its own, I am pretty sure its nothing to do with LoadObj.

    On my index.php file I have the javascript file:
    Head Section:
    <script type="text/javascript" src="tigra_scroller/sample2/ts_files/scroll.js"></script>

    Body Section:
    <div id="contentarea">
    <script type="text/javascript">ajaxpage('home.html', 'contentarea'); //load "home.html" into "contentarea" DIV
    </script></div>

    Html Page Loaded into 'Contentarea' has a script within the body:
    <table border="0" cellpadding="3" cellspacing="1" align="center" bgcolor="#336699">
    <tr><td class="header2" width="150">Vertical, Autoscroll Mode</td></tr>
    <tr><td bgcolor="#ffffff" width="150"><SCRIPT LANGUAGE="JavaScript">Tscroll_init (0)</SCRIPT></td></tr>
    </table>

    I did try using a <div> with a unique id but no go.

    Any ideas,
    thanks in advance

  2. #2
    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

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. #3
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content and Cross Browser marquee II

    Hi,
    I have changed out the old script I was using and now using the Cross Browser marquee II ( http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm ) with the Dynamic Ajax Content in the event it would work since there was no .js on the page loading. I have been fooling around with the pollcontent, but still have not suceeded.

    http://www.raceforaydan.com

    the page loading is http://www.raceforaydan.com/thermoindex.html

    I would really appreciate any help you may provide.

  4. #4
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I also get a javascript error 'object required' cross_marquee.style.top=0
    Last edited by edandrea; 10-31-2007 at 10:24 PM.

  5. #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

    First off, remove this from the script:

    Code:
    window.onload=initializemarquee
    Then at the bottom of your thermoindex.html page, add (red):

    Code:
    <td><img src="images/spacer.gif" width="5" /></td>
    
    </tr>
    <tr><td colspan="2"><img onload="initializemarquee();" src="images/spacer.gif" height="5" /></td></tr>
    
    </table>
    
    </body>
    </html>
    - John
    ________________________

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

  6. #6
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Cool. I did attempt locally to take out the 'onLoad' but only to place it in the <body> after reading through the faq's and your writing on basic Ajax properties and applying 'pollC'. I would never have guessed where to have placed the "initializemarquee()"

    Fantastic, it is working. I tried hard to fix it on my own.

    Should I be concerned with the error in the document?
    line 51 (cross_marquee.style.top=0) 'object required'


    I am curious.

    If not Thank you very much.

  7. #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

    It should go away if you follow the first part of my instructions:

    First off, remove this from the script:

    Code:
    window.onload=initializemarquee
    - John
    ________________________

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

  8. #8
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, but it has not fixed it. I have checked my local and serverfiles and it has been removed.

    I dont want to guess but would it have anything to do with this?

    window.attachEvent("onload", initializemarquee)

    Just a shot in the dark.

  9. #9
    Join Date
    Apr 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I removed this part of the script and now no error, do you think this is ok to use? Or will it mess up something else?

    if (window.addEventListener)
    window.addEventListener("load", initializemarquee, false)
    else if (window.attachEvent)
    window.attachEvent("onload", initializemarquee)
    else if (document.getElementById)
    Last edited by edandrea; 11-01-2007 at 11:10 AM.

  10. #10
    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

    Oh yeah, I must have missed that. All that code does is load (initialize) the script. Since you are loading the script via an image that appears with and slightly after the content that the script is intended to work with, when and if that content is added, it's fine to remove that other initialization code.

    In fact, you should get rid of it.
    Last edited by jscheuer1; 11-01-2007 at 11:57 AM.
    - John
    ________________________

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

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
  •