Results 1 to 7 of 7

Thread: Dynamic AjAX contend - IE problems

  1. #1
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Dynamic AjAX contend - IE problems

    Dynamic Ajax Content
    http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    Hi, the script i awsome !!, but I have a little problem with IE, because my content have a png images so a have a png fix script, but in IE when I cratinga link to load:

    HTML Code:
    <a href="javascript:ajaxpage('budowa.html', 'okno_wlasciwe'); loadobjs('css/glowne_style.css', 'js/bgsleight');">Aktualnosci</a>
    The same script is loading in index page and there is working but in AjAX div not , I tried to change the name of loading to div script but nothing hapends. Can someone help me??? pls.

    Ps. Sorry for my bad english

  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

    This has come up before. If you have a script loaded on the page and you then load more content via the AJAX include that you want to be acted upon by your script, you have to figure out what is really going on and what you want to have happen. Just loading the whole script all over again will likely create conflicts with its first run that occurred when the page was first loaded. More likely, all you need to do is load a small script that runs the functions of the main script that are relevant to the newly included content.
    - John
    ________________________

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

  3. #3
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Will you help me with that script ?? because i'm a noob in java and php.....????? Can You???

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

    I'm a little weak in AJAX and PHP but have a rough understanding of what is going on there. I'm fairly strong in javascript. There is no Java involved here (that's a different language).

    If you provide a link to your page, I will try to find the relevant code and a way to modify it. Unfortunately, my favorite tool - setting up a local demo, is probably impossible or highly complex owing to the domain specific nature of portions of AJAX. I have other tools though, so I'll give it my best shot if you provide the link:

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

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

  5. #5
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK
    http://www.karolewo.com/test/index.html you need to hit the Aktualnosci button, and here's a link to that script http://www.karolewo.com/test/js/bgsleight.js

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

    OK, you threw me a little there at first. The link you gave me was to a frameset, the actual page is:

    http://edu.apple.pl/zsliz_karolewo/test/index.html

    The problem is just as I suspected, js/bgsleight.js is already loaded on that page, it doesn't need to be loaded again, and loading it again will do nothing, at least nothing good. And we need to be sure that the css is loaded first. So, to start, change your link for the Aktualnosci button to:

    Code:
    <a href="javascript:loadobjs('css/glowne_style.css'); ajaxpage('budowa.html', 'okno_wlasciwe');">Aktualnosci</a>
    Now all we need to do is look in the script for Dynamic Ajax Content (/js/DAC.js) to see where we need to run the function alphaBackgrounds() from
    the js/bgsleight.js script. I vote for here:

    Code:
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    Find the above in /js/DAC.js and change it to:

    Code:
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
    document.getElementById(containerid).innerHTML=page_request.responseText
    if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent)
    alphaBackgrounds();
    }
    }
    That should do it. Except if there is a problem in running alphaBackgrounds() in IE every time you call the ajaxpage() function. If so, more work needs to be done.

    There is one other matter, on:

    http://edu.apple.pl/zsliz_karolewo/test/index.html

    where you have:

    Code:
    <script language="javascript" src="js/DAC.js"></script>
    To follow the terms of use at DD, it should read:

    Code:
    <script language="javascript" src="js/DAC.js">
    
    /***********************************************
    * Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    - John
    ________________________

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

  7. #7
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Your great THX, A BIG THX .........And sorry for that terms, I thought that if they are placed in DAC.js everthing is ok. Many thx

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
  •