Results 1 to 2 of 2
Thread: Java and Html issue
- 07-02-2012, 12:53 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 1
- Rep Power
- 0
Java and Html issue
Making a webpage and trying to use java to make the site a bit more managable. I'm new to both languages.
Here's my java file I'm trying to run
//Comic.js
var Index= 0;
var NumComics = 1;
var ComicArray = new Array(NumComics);
public class Comic {
public int ComicNumber;
public String ComicTitle;
public String ComicDate;
//constructor
public Comic(int a, String t, String d)
{
ComicNumber = a;
ComicTitle = t;
ComicDate = d;
}
}
function MakeArrays()
{
ComicArray[0] = new Comic(12001, "The Grass is Always Greener", "July 1 2012");
}
function WriteComicTitle()
{
MakeArrays();
System.out.println(ComicArray[Index].ComicTitle);
}
Here's the html I'm using to do what needs to be done.
<script type="text/javascript"src="Scripts/Comic.js">WriteComicTitle();</script>
Other then the line above in my html, all the html code works (tables pics etc..) However my java is not running. Here's what I have accounted for already; file paths are all correct, I have gone over the sintax a dozens times. What am I doing wrong here. I'm an experienced c# and c++ if that helps anyone understand why I may be makeing a stupid mistake here. thanks in advance for the help.
DanLast edited by DanielOwsley; 07-02-2012 at 12:55 AM.
-
Re: Java and Html issue
Well, for one, you've asked your JavaScript question on a Java forum when you should be asking it on a JavaScript forum, since the two languages are not the same and in fact are very different. Fortunately Google can help you find your JavaScript forum. I will be locking this question soon as it is off topic for this forum. Best of luck with solving your problem.
Last edited by Fubarable; 07-02-2012 at 01:07 AM.
Similar Threads
-
Regular Expression issue and setName() method issue
By geforce in forum New To JavaReplies: 2Last Post: 01-30-2012, 03:33 AM -
html and java
By dnbhead in forum New To JavaReplies: 2Last Post: 12-13-2011, 06:40 PM -
Using HTML in java
By hitmen in forum AWT / SwingReplies: 3Last Post: 02-26-2009, 05:58 AM -
Java + html
By GabWit in forum New To JavaReplies: 4Last Post: 01-25-2009, 03:58 AM -
How can I include a html file in html textarea?
By surya_dks in forum New To JavaReplies: 2Last Post: 10-04-2008, 07:20 AM


LinkBack URL
About LinkBacks


Bookmarks