Javascript Help
Top Part shows the output I am getting from Amazon and second part shows the function I am using to get the information.
<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?
<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
Special Offers
Portfolio
Testimonials