Guest User

Untitled

a guest
Feb 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. var displaySuccess = function(req){
  2. var imgArr = new Array;
  3. var xmlDoc = req.responseXML;
  4. var hasOpts = false;
  5. //Retrieve the btid value from the returned XML.
  6. var args = xmlDoc.getElementsByTagName('Argument');
  7. for(i=0; i < args.length; i++){
  8. var curArg = args[i];
  9. var attrName = curArg.getAttribute('Name');
  10. var attrValue = curArg.getAttribute('Value');
  11. if(attrName == "btid"){
  12. courseID = attrValue;
  13. } else if(attrName == "btops")
  14. hasOpts = true;
  15. }
  16. newDiv = Builder.node('div',{id: 'theTexts', style:'display:none;'});
  17. var items = xmlDoc.getElementsByTagName('Item');
  18. for(var i=0; i < items.length; i++) {
  19. var theItem = items[i];
  20. var theASIN = theItem.getElementsByTagName('ASIN').item(0).firstChild.nodeValue;
  21. imgArr[i] = theASIN;
  22.  
  23. //Various other js code that isn't exactly relevant to this discussion.
  24.  
  25. theOutput = Builder.node('p',{className: 'item'},[
  26. Builder.node('img',{src: imgURL, classname: 'item-img', id: theASIN, alt: title.firstChild.nodeValue}),
  27. Builder.node('em',title.firstChild.nodeValue),
  28. Builder.node('br'),
  29. byList,
  30. Builder.node('br'),
  31. Builder.node('br'),
  32. Builder.node('strike','List Price: '+listPrice+''),
  33. Builder.node('br'),
  34. Builder.node('strong','Amazon Price: '+ourPrice+''),
  35. Builder.node('br',{className: 'clearer'})]);
  36. //Append theOutput to the newDiv.
  37. newDiv.appendChild(theOutput);
  38. }
  39. $('texts'+courseID).appendChild(newDiv); //This is the line that throws the error in Safari.
  40. Effect.Appear('theTexts');
  41. for(i=0; i<imgArr.length; i++){
  42. new Draggable(imgArr[i],{revert:true});
  43. }
  44. }
Add Comment
Please, Sign In to add comment