TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 432
  • Total: 432

problem adding html code to block

Started by nadrojcote, January 13, 2010, 10:09:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nadrojcote

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>

IchBin

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.

nadrojcote


IchBin

Then there is probably something wrong with your code.

Lesmond

Shouldn't there be a Script <script> tag to start the code somewhere, as there is a closing tag </script> ???

ZarPrime

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

Lesmond

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>

ZarPrime

Lesmond's code works so I will mark this topic solved. O0

ZarPrime

Lesmond

Thank ZP, was waiting for the OP to get back thats why I did mark it O0

This website is proudly hosted on Crocweb Cloud Website Hosting.