How to print the src attribute of an ImageElement
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <751fc82e-15af-44aa-afe3-be5996da082b@h11g2000prf.googlegroups.com> |
Hi,
Can you please tell me how call I print out the src attribute of an
ImageElement to the screen?
I have the following code, but I only see 1 character 'h'.
nsCOMPtr<nsIDOMHTMLImageElement> img;
if (img) {
printf ( "img element is not null");
nsAutoString srcAttr;
img->GetAttribute(NS_LITERAL_STRING("src"), srcAttr);
if (!srcAttr.IsEmpty()) {
printf("%s", srcAttr.get());
}
}
Thank you for any help.