SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member br-design.pl's Avatar
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with IE and DOM object, please help!

    Hi, Ive got this code for AJAX add to cart function.
    You can see it live on:

    http://www.fenris2.br-design.pl/sklep/produkt/308

    please click DODAJ PRODUKT DO KOSZYKA
    in FF or SAFARI the mini cart box updates it self, but on IE there is a problem with i cannot handle.

    Here is the Java script:
    Code:
    var ilekosz 	= document.getElementById('ilekosz');
    var sumakosz	= document.getElementById('sumakosz');
    	if(obj.responseXML) {
    		var xml = obj.responseXML;
    		var koszyk = xml.childNodes[0];
    	     var koszykMessage = document.getElementById("koszyk-message");
    
    		koszykMessage.style.display = "block";
    		koszykMessage.innerHTML = 'Doda?e? produkt!';
    				
    		var outputIleKosz 	= koszyk.getAttribute('ilekosz');
    		var outputSumakosz 	= koszyk.getAttribute('sumakosz');
    		ilekosz.innerHTML = outputIleKosz;
    		sumakosz.innerHTML = outputSumakosz;
    				
    	} else {
    		alert(obj.responseText);
    	}
    And here is the markup:
    HTML Code:
     <div class="msg">
      <span id="koszyk-message" style="display:none;"> </span>
      Liczba produktów: <b id="ilekosz">{$ilekosz}</b><br />Kwota do zaplaty: <b id="sumakosz">{$sumakosz}</b> z?.
     </div>
    IE has got some problem with it, i dont understand its error messages, so please, if anyone can help, than please help, ive spend haours on this.
    --
    Bartosz Rychlicki
    br-design.pl

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    errors

    The page loads in IE with no errors for me. What error message are you getting?

  3. #3
    SitePoint Member br-design.pl's Avatar
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to click : click DODAJ PRODUKT DO KOSZYKA

    Than IE will hang it self and display error in its console. I cant right now paste here a exact error (beacose Im on Mac right now) but it says something about wrong data type or something like "object is needed".
    --
    Bartosz Rychlicki
    br-design.pl

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    error message

    Sorry, your first post did say that.
    Opera shows this in it's error console
    JavaScript - http://www.fenris2.br-design.pl/sklep/produkt/308
    Unknown thread
    Error:
    name: TypeError
    message: Statement on line 22: Type mismatch (usually a non-object value used where an object is required)
    Backtrace:
    Line 22 of linked script http://www.fenris2.br-design.pl/scri...axAddToCart.js
    var outputIleKosz = koszyk.getAttribute("ilekosz");
    Line 374 of linked script http://www.fenris2.br-design.pl/scripts/advajax.js
    obj[("on" + name)].apply(null, args);
    Line 185 of linked script http://www.fenris2.br-design.pl/scripts/advajax.js
    obj.raiseEvent("Success", obj);
    Line 126 of linked script http://www.fenris2.br-design.pl/scripts/advajax.js
    case 4:
    At unknown location
    [statement source code not available]
    Just a thought, could this be something to do with character encoding? Are you using a non 0-128 char code somewhere as a variable or id name?

  5. #5
    SitePoint Member br-design.pl's Avatar
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is helpfull but i still have no idea, maybe its something with koszyk.getAttribute. Koszyk is node from XML like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <koszyk ilekosz="1" sumakosz="0,00" />
    --
    Bartosz Rychlicki
    br-design.pl

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    comma

    Is sumakosz="0,00" supposed to have the comma?
    ie. It's a string and not a number.


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
  •