开发者

pop up box in cdata xml tags

I'm trying to load a pop up window within xml cdata tags but not getting any luck,

This is my code on the filename.xml page

<?xml version="1.0" encoding="utf-8"?>
<pagesettings>
<record>    

<bgColor>开发者_JAVA技巧0x000000</bgColor>
<bgTransparency>80</bgTransparency>
<horizPosition>right</horizPosition> <!-- possible values: left; right -->
<htmlContent>
<en>
<![CDATA[       
<p></p><p class="mainTitle">TITLE HERE</p><p>    </p>
<p>CONTENT HERE</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<A HREF="http://www.google.com"><img src="images/media/logo.jpg"></A>

<p>&nbsp;</p>   
]]>         
</en>       
</htmlContent>
</record>   
</pagesettings>

The logo works fine , an image appears and once you click it it goes to the link. I want to convert that href link into a pop up window.

For example i want google.com in a pop up window 250x250 how would i go about this remembering that it is xhtml and cdata tags.


XHTML and CDATA raise no particular challenges here. You can't put a <![CDATA[ section inside another <![CDATA[ section, but since you don't need to include a < or & character in your script, you have no need to. eg.:

<htmlContent><en><![CDATA[       
    <p class="mainTitle">TITLE HERE</p>
    <p>CONTENT HERE</p>
    <a href="http://www.google.com" id="popup"><img src="images/media/logo.jpg" alt="Google"></a>
    <script type="text/javascript">
        document.getElementById('popup').onclick= function() {
            return !window.open(this.href, '_blank', 'width=250,height=250');
        };
    </script>
]]></en></htmlContent>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜