homepage Welcome to WebmasterWorld Guest from 54.161.192.130
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
How to insert Java on a webpage
How can i insert Java on a web page
lixsmk1

5+ Year Member



 
Msg#: 3983948 posted 12:39 pm on Sep 4, 2009 (gmt 0)

Hi,
I want to insert a java code on my webpage. Can you please let me know how to do that and where to put the code and what will be the start and ending codes wrapping the main java code, thanks.

 

jackhack

5+ Year Member



 
Msg#: 3983948 posted 4:22 pm on Sep 4, 2009 (gmt 0)

Well basically you want to create an Applet, which is a java program called with HTML coding.

I am stuck with displaying my applet and need help aswell.

whoisgregg

WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3983948 posted 4:52 pm on Sep 4, 2009 (gmt 0)

Java and JavaScript are two very different things. JavaScript can be included like so:

<script type="text/javascript">
// <![CDATA[
alert('Your code here!');
// ]]>
</script>

Whereas a Java Applet is an external file and is embedded in a document much like a Flash movie. The simplest form of this (according to Sun's documentation) looks like:

<applet code="Applet1.class" width="200" height="200">
Your browser does not support the applet tag.
</applet>

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3983948 posted 11:02 pm on Sep 4, 2009 (gmt 0)

And as for JavaScript, it's generally best practice to put it in an external file and include it like so (vs. including the JavaScript code in the HTML page):


<script type="text/javascript"
src="yourJavaScriptFile.js"></script>

lixsmk1

5+ Year Member



 
Msg#: 3983948 posted 11:45 pm on Sep 4, 2009 (gmt 0)

Well i was provided with a java script code and asked to put it anywhere on a live page to check the status if it work. It is a chat option for technical help. I did include it in to the source code but after i saved the file it seems to have shift from the place i saved it but still appears on the page in source code.Though i can't see it on the front end...? any guesses will it still work for me or do i have to do something else. cheers

lixsmk1

5+ Year Member



 
Msg#: 3983948 posted 8:51 am on Oct 22, 2009 (gmt 0)

any guesses? any one

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3983948 posted 9:15 am on Oct 22, 2009 (gmt 0)

did you try putting the javascript code in the script tag as described by whoisgregg?

lixsmk1

5+ Year Member



 
Msg#: 3983948 posted 11:59 am on Oct 23, 2009 (gmt 0)


Right this is an example of the xact thing...how do i make it work on my site...do i just need to copy paste this code on a live page or do something else to make it work ?

<!-- meer HELP CODE BEGIN-->
<link href="http://abc.000.000.dw/css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="http://www."></script>
<script language="javascript" src="http://abc.000.000.dw/meer.js"></script>
<script language="javascript">
var button_type = BUTTON_TYPE_IMAGE;
var online_display = "http://abc.000.000.dw/img/online.jpg";
var offline_display = "http://abc.000.000.dw/img/offline.jpg";
var button_assign_type = BUTTON_ASSIGN_NULL;
var chat_window_skin ="blue";
var chat_window_width = 495;
var chat_window_height = 495;
var enable_invitation = true;
var invitation_popup_type = INVIATION_STYLE_SLIDEDOWN;
var invitation_skin = INVIATION_STYLE_BLUE;
var invitation_dept_id = 1;
var define_url = "http://abc.000.000.dw";
livehelp();
</script>
<!-- meerHELP CODE END-->

Regards

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3983948 posted 4:31 pm on Oct 23, 2009 (gmt 0)

you should be able to paste that in the <head> of the document(s).

in some cases it may help page rendering speed to move the script tags to just before the </body> tag, but it should work ok in the head.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved