# Quick Question, If Statement on Blank Data from XML

**URL:** <https://forum.kirupa.com/t/quick-question-if-statement-on-blank-data-from-xml/259975>\
**Category:** flash\
**Created:** [May 11, 2008, 5:28am UTC](https://forum.kirupa.com/t/quick-question-if-statement-on-blank-data-from-xml/259975 "2008-05-11T05:28:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddykraven](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@bigdaddykraven](https://forum.kirupa.com/u/bigdaddykraven)\
**Post date:** [May 11, 2008, 5:28am UTC](https://forum.kirupa.com/t/quick-question-if-statement-on-blank-data-from-xml/259975/1 "2008-05-11T05:28:06Z")

</div>

Ok, it worked once but stopped working when I added more information into the XML database. Anyway, I have a section of my xml that has a URL it pulls in, but for some, there’s not website to link to so I wanted to leave it blank. In XML, it looks like this:

\<url\>\</url\>

I have my statement set up in the following code. The else statement works fine, but the if statement calling for nothing doesn’t. Here’s the code:

```auto

if (url[p]=="") {
                url_txt.htmlText = "<p alight=\"right\">No URL, See Description</p>";
            }else{
            url_txt.htmlText = "<p align=\"right\"><a href=\""+url[p]+"\" target=\"_blank\">"+url[p]+"</a></p>";
            }

```

On the selections with no URL in my XML, it says Undefined, and the ones that have a URL, work as specified.

I’ve also tried making the if statment (url[p]==" ") but that doesn’t work either.

I know its something easy, but I need a pair of fresh eyes to look at it as I’ve been coding this site for 2 weeks.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bigdaddykraven](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@bigdaddykraven](https://forum.kirupa.com/u/bigdaddykraven)\
**Post date:** [May 11, 2008, 7:13am UTC](https://forum.kirupa.com/t/quick-question-if-statement-on-blank-data-from-xml/259975/2 "2008-05-11T07:13:12Z")

</div>

I figured it out myself.

for future reference, instead of “”, you can simply use undefined.

This found that that XML response was undefined and spits out my string instead (which by the way, I realized I mis-spelled align and fixed that too :P)
