Jump to content

Little Goat

Members
  • Posts

    733
  • Joined

  • Last visited

Everything posted by Little Goat

  1. here's an example: <html><head><title>attack of the killer popups</title><script type="text/javascript">function popup(amount){for(i=1 i<=amount i++){window.open("url of your file",status=no,toolbar=no,location=no,menubar=no,width=400,height=200)}}</script></head><body><input type="button" value="start" onmousedown="popup(anynumberhere)"/></body></html> and the code of the opened pages <html><head><title>attack of the killer popups</title><script type="text/javascript">function popup(amount){for(i=1 i<number i++){window.open("url of your file",status=no,toolbar=no,location=no,menubar=no,width=400,height=200)}window.close()}</script></head><body><input type="button" value="OK" onmousedown="popup(anynumberhere)"/></body></html> anyone correct me if i'm wrong, i'm new :)you can also use the math.random to make a random number of popups too, I think.well, I just tried it and it doesn't work for me, maybe someone can fix it for you.:)LG
  2. Hi,thanks for answering paetje, I tried your code , but I guess I don't understand what is taking place. I altered my XSL File to this; <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title><xsl:value-of select="page/title"/></title> <style type="text/css"> <xsl:value-of select="page/style"/> </style> </head> <body> <table width="100%"> <tr> <td colspan="2" id="header"><xsl:value-of select="page/title"/></td> </tr> <tr> <td id="links" width="20%"> <xsl:for-each select="page/links/link"> <xsl:variable name="href" select="to"/> <a href="{$href}"><xsl:value-of select="show"/></a><br /> </xsl:for-each> </td> <td id="content" width="80%"> <xsl:value-of select="page/content"/> </td> </tr> </table> </body> </html> </xsl:template> <xsl:template match="newline"> <br/> <xsl:apply-templates/> </xsl:template></xsl:stylesheet> But it still doesn't work. the XML file is the same.could you try to explain this to me or show me how to do it in my code?Oh and one more thing. does anyone know how to change the username on this forum? thanks, LG
  3. HiI’m new at XSLT and just for fun I decided to try making an XSLT file that makes it so that anyone can put in their content in the XML file and the XSLT file will make a nice web page out of it. I’m trying to make it so that whenever a user (or anyone else) puts <newline/> in the code, the XSLT will put a <br /> tag in the code. Right now it doesn’t do anything. Here are my filesXSLT <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title><xsl:value-of select="page/title"/></title> <style type="text/css"> <xsl:value-of select="page/style"/> </style> </head> <body> <table width="100%"> <tr> <td colspan="2" id="header"><xsl:value-of select="page/title"/></td> </tr> <tr> <td id="links" width="20%"> <xsl:for-each select="page/links/link"> <xsl:variable name="href" select="to"/> <a href="{$href}"><xsl:value-of select="show"/></a><br /> </xsl:for-each> </td> <td id="content" width="80%"> <xsl:value-of select="page/content"/> <p><xsl:apply-templates select="newline"/></p> </td> </tr> </table> </body> </html> </xsl:template> <xsl:template match="newline"> <br/> </xsl:template></xsl:stylesheet> and XML <?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?><page> <title>This will show in the title space and the header</title> <style> body {background-color:aqua;} #header {background-color:teal; font-size:300%; font-family:Bradley Hand ITC,forte; text-align:center; height:128; color:white;} #links {background-color:red; font-size:150%; height:250;} #content {background-color:#ffffee; text-align:center;} </style> <links> <link> <show>Home</show> <to>example.htm</to> </link> <link> <show>home2</show> <to>example.htm</to> </link> </links> <content>Content here<newline/>this break doesn’t work </content></page> Thanks in advanceLG
×
×
  • Create New...