I get tryng to work this code. First I would like to add all items within "Feature" tags. Each time I run it , I only get the last item "TriZone". How can get all items and add a line break ? Top Part shows the output I am getting from Amazon and second part shows the function I am using to get the information.
Javascript Help
2
I get tryng to work this code. First I would like to add all items within "Feature" tags. Each time I run it , I only get the last item "TriZone". How can get all items and add a line break ?
Top Part shows the output I am getting from Amazon and second part shows the function I am using to get the information.
I am also trying to get "URL" value from this but no luck. How can I get URL element?
I am hoping that someone can easily find the solution to this.
Thanks
Top Part shows the output I am getting from Amazon and second part shows the function I am using to get the information.
Code:
<Feature>Rechargeable </Feature>
<Feature>Dynamic </Feature>
<Feature>manual</Feature>
<Feature>TriZone</Feature>
*****************
function getinfo(){
var o = {};
var a = response.getDescendants();
for(var i=0;i<a.length;i++) {
if(a[i].getType() == XmlService.ContentTypes.ELEMENT){
switch(a[i].asElement().getName()){
case "Feature" :
o.feature = a[i].asElement().getText();
}
}
} I am also trying to get "URL" value from this but no luck. How can I get URL element?
Code:
<SmallImage>
<URL>http://ecx.images-amazon.com/images/I/313lIweldTL._SL75_.jpg</URL>
<Height Units="pixels">75</Height>
<Width Units="pixels">41</Width>
</SmallImage>
<MediumImage>
<URL>http://ecx.images-amazon.com/images/I/313lIweldTL._SL160_.jpg</URL>
<Height Units="pixels">160</Height>
<Width Units="pixels">87</Width>
</MediumImage>
***********************
function getinfo(){
var o = {};
var a = response.getDescendants();
for(var i=0;i<a.length;i++) {
if(a[i].getType() == XmlService.ContentTypes.ELEMENT){
switch(a[i].asElement().getName()){
case "SmallImage" :
o.smallimage = a[i].asElement().getText();
}
}
} Thanks
- kdavies
- davidmiller840
Next Topics on Trending Feed
-
2