Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » 2 questions 1 HTML an 1 Java script.
Closed Thread
Old 05-17-2009, 08:01 PM   #1 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default 2 questions 1 HTML an 1 Java script.

1) In HTML is there any way to change the default formatting of the code tags? I don't want the font changed but i would like to make them stand out more an I don't want to use the "b" tag every time i post some code up.

2) In Java script I am trying to get a small script going that will display the viewers IP address the one I have isn't rendering properly the example can be viewed here if any one has any suggestions I would be happy to test it out.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline  
Old 05-17-2009, 09:47 PM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: 2 questions 1 HTML an 1 Java script.

1) Use CSS to style the font.

Code:
<html>
<head>
<style type="text/css">
p {
font-weight:bold;
}
</style>
</head>
<body>
<p>
Some font.
</p>
</body>
</html>
With this, everything inside <p></p> tags will be bold. You can change the tag if you want to use <p></p>.

2) You can't view IP's with Javascript.
__________________

Need website help? PM me!
CrazeD is offline  
Old 05-17-2009, 09:50 PM   #3 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: 2 questions 1 HTML an 1 Java script.

Thanks for the help with the HTML, I don't want to view them i want them to be displayed on the end users screen the script i have in that example is directly taken from a JS tutorial on how to do just that but I can't get it to work on my site for some reason.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline  
Old 05-17-2009, 10:08 PM   #4 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: 2 questions 1 HTML an 1 Java script.

It doesn't work because you can't do it. I'm not sure what that code on your link is supposed to be doing, but I can tell you that you can't display an IP with Javascript. You need a server side language. You could use AJAX if you wanted, but you'd still need a server side language.

This is how to display an IP with PHP:

PHP Code:
<?php

echo $_SERVER['REMOTE_ADDR'];

?>

__________________

Need website help? PM me!
CrazeD is offline  
Old 05-17-2009, 10:13 PM   #5 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: 2 questions 1 HTML an 1 Java script.

Cheers I will give it a go.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline  
Old 05-18-2009, 08:13 PM   #6 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: 2 questions 1 HTML an 1 Java script.

Just to let you know the PHP worked, thanks for that mate.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yahoo Pool/ Java Script D-Rocks Computer Networking & Internet Access 1 03-23-2009 01:25 AM
Updates for Java eliminate many security holes Trotter Browser & General Internet Questions 1 07-11-2008 09:54 PM
Some Java Questions Redavni Programming Discussions 1 06-30-2008 09:55 AM
questions about Java programming fleahuncut Programming Discussions 4 09-12-2007 01:43 AM
Java SCript Help NEEDED! kellee91 Browser & General Internet Questions 1 06-05-2007 12:20 PM