TinyPortal

Development => Support => Topic started by: nadrojcote on January 13, 2010, 10:09:43 PM

Title: problem adding html code to block
Post by: nadrojcote on January 13, 2010, 10:09:43 PM
hi I am wondering if anyone could help me add this code to a block when I do it shows all the code in the block instead of what its supposed to be showing. I am using an html/java block and this is the code.
<center>
// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// for NN4/IE4
if (self.screen) {     
        width = screen.width
        height = screen.height
}

// for NN3 w/Java
else if (self.java) {   
       var javakit = java.awt.Toolkit.getDefaultToolkit();
       var scrsize = javakit.getScreenSize();       
       width = scrsize.width;
       height = scrsize.height;
}
else {

// N2, E3, N3 w/o Java (Opera and WebTV)
width = height = '?'
}

document.write("Your Screen Resolution is set to: "+ width +"Ãâ€""+ height)
     
//-->
</script><br/>

We Recommend using Mozilla Firefox @ 1280x800 or higher <<-- only edit this bit
</center>
Title: Re: problem adding html code to block
Post by: IchBin on January 14, 2010, 01:54:25 AM
When you put the code in the editor, you must put the editor into code mode. You can do this by clicking the <> button. Then you will need to put your code in and save it.
Title: Re: problem adding html code to block
Post by: nadrojcote on January 14, 2010, 02:48:10 AM
thats what I am doing.
Title: Re: problem adding html code to block
Post by: IchBin on January 14, 2010, 03:48:02 AM
Then there is probably something wrong with your code.
Title: Re: problem adding html code to block
Post by: Lesmond on January 14, 2010, 01:32:29 PM
Shouldn't there be a Script <script> tag to start the code somewhere, as there is a closing tag </script> ???
Title: Re: problem adding html code to block
Post by: ZarPrime on January 14, 2010, 01:37:01 PM
One reason all the text is shown is that there are no script tags in the code.  Give us a link to the actual script so that we can try it.

ZarPrime

Edit:  Ah, pipped by Les.  Sorry about that Les. :D
Title: Re: problem adding html code to block
Post by: Lesmond on January 14, 2010, 02:15:55 PM
OK fixed it should be like this...

<center>
<script type="text/javascript">
// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

// for NN4/IE4

if (self.screen) {     
        width = screen.width
        height = screen.height
}

// for NN3 w/Java
else if (self.java) {   
       var javakit = java.awt.Toolkit.getDefaultToolkit();
       var scrsize = javakit.getScreenSize();       
       width = scrsize.width;
       height = scrsize.height;
}
else {

// N2, E3, N3 w/o Java (Opera and WebTV)
width = height = '?'
}

document.write("Your Screen Resolution is set to: "+ width +"Ãâ€""+ height)
     
//-->
</script><br/>

We Recommend using Mozilla Firefox @ 1280x800 or higher <<-- only edit this bit
</center>
Title: Re: problem adding html code to block
Post by: ZarPrime on January 15, 2010, 04:46:40 PM
Lesmond's code works so I will mark this topic solved. O0

ZarPrime
Title: Re: problem adding html code to block
Post by: Lesmond on January 15, 2010, 05:06:46 PM
Thank ZP, was waiting for the OP to get back thats why I did mark it O0