XML Cdata and Java Script working together?

Hi,

I have a gallery that when the image is clicked a window pops up with a description.

the description is in the xml file

but if i have a special character ( ’ apostrophe )i n the xml file the pop up will not work open

I tried cdata but not sure how to implement that.

The gallery was built in flash and but the pop up is html

here is the java is sits in an html page where the flash is embedded

do i need to tell the javascript that i am using cdata?

any help would be great.

Thanks

Ponyack

<script language="JavaScript" type="text/javascript">
            function popUp(target, w, h, path, caption, description){
                var scrW = screen.width;
                var scrH = screen.height;

                var x = Math.floor((scrW - w)/2);
                var y = Math.floor((scrH - h)/2);

                var uri = target + "?path=" + path + "&caption=" + caption + "&description=" + description;
                wnd = window.open(uri, 'galleryImage', 'height=' + h + ', width=' + w + ', left=' + x + ', top=' + y + ', toolbar=no, location=no, directories=yes, status=no, menubar=yes, scrollbars=yes, resizable=yes');
            }

            function cleanPopUp(w, h, path){
                var scrW = screen.width;
                var scrH = screen.height;

                var x = Math.floor((scrW - w)/2);
                var y = Math.floor((scrH - h)/2);

                wnd = window.open('', 'galleryImage', 'height=' + h + ', width=' + w + ', left=' + x + ', top=' + y + ', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no');
                wnd.document.write('<body topmargin=0 bottommargin=0 rightmargin=0 leftmargin=0>');
                wnd.document.write('<img src="' + path + '" />');
                wnd.document.write('</body>');
            }
        </script>

Escape characters like apostrophies, quotes

’ becomes ’

Thanks for the reply.

So how can I get the ’ apostrophe to parse?

I tried using the special character ' but the popup hmtl window would not work

I apologize, but I am new to most of this so I am learning as I go.

Could you show an example or link me to an explanation.

The next post is the popup html code

Thanks

Ponyack

pop up html code

    <head>
        <script language="JavaScript" type="text/javascript">
            function getVariable(varName){
                var arg = document.location.search.substring(1).split('&');
                var variable = "";
                var i;
                for(i=0; i<arg.length; i++){
                    if(arg*.split('=')[0] == varName){
                        if(arg*.split('=').length>1){
                            variable = unescape(arg*.split('=')[1]);
                        }
                        return variable;
                    }
                }
                return "";
            }
        </script>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <style type="text/css">
              TD.image{
                  text-align: center;
                  padding: 0px;
              }

            TD.caption{
                color: #ffff33;
                font-size:11pt;
                font-family:Verdana;
                font-weight:bold;
            }

            TD.description {
                color:#ffffff;
                font-size:10pt;
                font-family:Verdana;
                
            }
        </style>
     </head>
    <body bgcolor=#666666 topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 >
        <script language="JavaScript" type="text/javascript">
            var caption = getVariable("caption");
            var imgsrc = getVariable("path");
            var description = getVariable("description");

            document.write('<table border=0 cellpadding=5 cellspacing=0 width=100%>');
            document.write('<tr><td class="image"><img src=' + imgsrc + '></td></tr>');
            document.write('<tr><td class="caption">' + caption + '</td></tr>');
            document.write('<tr><td class="description">' + description + '</td></tr>');
            document.write('</table>');
        </script>
    </body>
</html>