Results 1 to 4 of 4

Thread: Dynamic Ajax Content DIV rightcollumn name problem

  1. #1
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content DIV rightcollumn name problem

    1) Script Title: Dynamic Ajax Content

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

    3) Describe problem:

    Hi,
    Last week I found the above mentioned script at this site.
    To be honest it is actually what I am looking for, for more than a year almost.

    So now I am a bit playing around with the demo file, with the cars etc etc.
    Trying to add some useless functions and and removing them again and trying to alter it a bit and see what it does.

    But now I have ran into a very strange "problem".

    Code:
    <div id="rightcolumn"><h3>Choose a page to load.</h3></div>
    When I alter the id "rightcolumn" into something else such as: justabike
    Code:
    <div id="justabike"><h3>Choose a page to load.</h3></div>
    Of course I altered the links as wel.

    Code:
    <a href="javascript:ajaxpage('ajaxfiles/external2.htm', 'justabike');">Ferrari Page</a>
    <a href="javascript:ajaxpage('ajaxfiles/external3.htm', 'justabike');">Aston Martin Page</a>
    And the CSS code.
    The loading of the content in the justabike layer works fine.
    However the CSS won't load for some reason.

    I have looked all over the .js files if there was any pre-defined ID for the location where the CSS should pop up but it looked all dynamically.

    So I am a bit confused now?
    Does anyone know what I could have overlooked?

    Thanks in advance.
    Last edited by ddadmin; 10-26-2007 at 01:02 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Do you mean "CSS" that appears inside the external files (ie: external2.htm or external3.htm)? Did you remember to also call the function loadobjs() to load any CSS files? For example:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea'); loadobjs('external.css')">test</a>

  3. #3
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes I did.

    Code:
    <div id="leftcolumn">
    <a href="javascript:ajaxpage('ajaxfiles/external.htm', 'rightcolumn'); loadobjs('ajaxfiles/style.css', 'ajaxfiles/tooltip.js');">Porsche Page</a>
    <a href="javascript:ajaxpage('ajaxfiles/external2.htm', 'rightcolumn');">Ferrari Page</a>
    <a href="javascript:ajaxpage('ajaxfiles/external3.htm', 'rightcolumn');">Aston Martin Page</a>
    
    <div style="margin-top: 2em">Load CSS & JS files</div>
    <a href="javascript:loadobjs('ajaxfiles/style.css', 'ajaxfiles/tooltip.js');">Load "style.css" and "tooltip.js"</a>
    <a href="javascript:loadobjs('ajaxfiles/style.css');">Load "style.css"</a>
    
    </div>
    
    <div id="rightcolumn"><h3>Choose a page to load.</h3></div>
    <div style="clear: left; margin-bottom: 1em"></div>
    The above works fine.
    However asap as I change the rightcolumn name into something else as I mentioned above it quits working.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    However asap as I change the rightcolumn name into something else as I mentioned above it quits working.
    I can't think of any reason why this would happen, except if "tooltip.js" is perhaps hard coding the reference to the rightcolumn's name. Check inside all your externally loaded files whether this is the case.

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
  •