Java Vs Javascript For AJAX?

Jan 19, 2007

I am a XHTML/CSS developer with an interest in AJAX. I am at the stage were I wish to learn how it's all done.

So my quesiton is this:

To develop AJAX applications do I need to learn JAVA or Javascript?

It may sound like a dumb question considering AJAX is mainly javascript and XML, however will learning JAVA first off be a benefit?

View 4 Replies


ADVERTISEMENT

Javascript Using Java Methods

Jul 23, 2005

Can Java classes/objects be used from within the javascript code on the
HTML page? I.e., can I call a Java method from the javascript function?

View 2 Replies View Related

How To Pass Value From Javascript To Java In Jsp

Jul 23, 2005

in JSP, it's easy to pass value from java-variable to
javascript-variable, like

js_function(a)
{ a=<%java-class.A%>
}

I'm wondering how is the other way around? I tried

js_function(a)
{ <%java-class.A=%>a
}

but there was compiling error.

View 3 Replies View Related

DHTML, JAVA, JAVASCRIPT?

Apr 19, 2001

Is DHTML a language? or is it a composition of JavaScript and css? Does Java(not javascript) has something to do in it?

What is actually the best to create client-side dynamic pages?
I know JAVA is used to create applets but I am not sure of wich is the most powerful....

Also, wich are the newer versions of all the above languages?

View 15 Replies View Related

Call A Java Method From Javascript

Jun 5, 2006

I am trying to call a java method from within my Javascript, but cannot
seem to get it to work. All the examples I have found online and in
the forums are using Java applets. I have a method that I want to call
that does a search, and produces a message dialog displaying the
results. Also, the class file lives next to the html file. How would
I invoke this in my code? This is what I have now:

<script>
function searchStrings(){
Searcher.search();
}
</script>
<form>
<input type="button" value="Search" onclick=searchStrings()>
</form>

View 2 Replies View Related

Passing Arrays To Java From JavaScript

Jul 20, 2006

This may be more of a Java question, but I feel that JavaScript experts
may be more qualified to help me find a solution.

In short: is it possible to call a Java method from JavaScript, passing
as an argument a JavaScript array (in my case, an array of doubles)?

Supposing I have array x containing only doubles, I have tried:
document.MyApplet.myMethod(x);

But the method only ever seems to receive "null" as an argument.
Conversely, if I try this with a String, or a single character, or
almost anything else, there isn't a problem. Any ideas?

View 1 Replies View Related

Communication Between Java Applet And Javascript

Jul 20, 2005

let's me explains my long problem:

I'm doing an intranet with a media part. So im must be able to upload files on
a ftp server AND have a record of informations about this file and meta date in
a MySQL database, shown in a php page.

So the first thing i was doing was:

1/ * A HTML Form, with a <input type="file"> which was uploading the file to
the web server. And then, in the next action-php-page, using ftp functions from
php to upload to the ftp server. But this make upload the file 2 times, which
slow, and the user can't do anythig except waiting in front of a blanck loading
page.

=> no way

(BTW, the site admin refuse that the ftp server and the web server to be the
same computer)

So i tried something else:

2/ * A HTML form, the user enter meta data about the media, click next, and
then, a php page which loads a java applet an pass informations to it (by param
tags).
The applet have a browse button, and a go button, which start the transfert
(JDK 1.4.1) trough the URLConnection. The file is uploaded once, and there is a
progress bar, which is wonderful.

But now, i need the src_file information wich is the java applet. So i have two
options:

A/ I make a post to the webserver from the applet. But i'm using session
identification (needed for tracing users actions) and i'm gonna use SSL in less
than one month, so i think it would be complicated.

B/ I export the information from the java applet to javascript, and then to
HTML hidden field, so that the user can submit the full-hidden-filled form. But
i can't make LiveConnect works.

i'm under Mac OS X 10.2 (jaguar) so i need to make work LiveConnect on both
Safari 1.0 (v85.6), mozilla 1.5, and Mac OS IE (5.2).

View 2 Replies View Related

Calling A Java Class From Within Javascript

Aug 23, 2006

Can you call a java class from within a javascript?

View 1 Replies View Related

Does Javascript Have A Stop() Method Like Java Applets?

Jul 23, 2005

A Java applet has two methods stop() and destroy() that get called when the user moves to a different page. Does javascript have anything similar?

View 2 Replies View Related

How To Execute An External Java Application By Javascript?

Jul 23, 2005

I am writing a java application as a mozilla extension.
Because mozilla uses javascript for the frontend,
i need the javascript to call my external java application
and pass one parameter to it.

View 1 Replies View Related

How To Set Default Homepage In Mozilla Using Java/JavaScript

Aug 23, 2006

Can anyone help me how to set default website as homepage in mozilla using java/ javascript.

Following javascripts code works in IE but not in Mozilla.

<input type="button" value="Set Default" onClick="this.style.behavior='url(#default#homepage)'
this.setHomePage('http://www.myDefaultWebsite.com')">

View 3 Replies View Related

Java Applet Verses JavaScript For Scrolling Text

Jun 24, 2002

I am looking at a client’s site that has a scrolling text bar at the bottom of the page for latest news. I have been asked to recommend whether they keep the scrolling text as a java applet or whether they make it dhtml with Javascript to make it scroll.

To be honest, I’m not sure whether there really is an important difference, in terms of download time, likelihood of working (if client browsers are better enabled for one verses the other), or whether there are any other reasons one should be used over the other.

View 2 Replies View Related

Why Do People Prefer Ajax Apps Over Java Applets?

Sep 21, 2006

From the common user perspective (like my grandma), why would they care
if its a java applet or an ajax application? Say I want to make a chat
system on my website...If i'm doing really involved Comet push-style
data communication, and rendering everything using DHTML, why would
users prefer that over a java applet?

Moreover, say I use a java applet to transfer data through a socket
connection, then use DHTML to display the data, so that basically the
front end is the same, but the backend is differs, why would a user
prefer the comet-style programming over applet?

I'm asking because I wrote an Ajax chat system through polling, and I
want to switch to a Comet push-style system because polling just isn't
responsive enough. I want to know if I can avoid Comet (since it is
alot of overhead for the server) and just use an applet in the
background to transfer data through socket connections, then use DHTML
to render the chat boxes.

View 8 Replies View Related

Ajax :: Format MS Excel Document As Output From Java?

Apr 17, 2009

I have a web application that has a few div tags in the base index.html and calls a java app for the output to the div tags. All is working ok, except when I try to format a ms-excel document as output from the java (to the div tag). If I invoke the java app directly in a web browser, the excel popup window comes up and my output goes to an excel document. However, if I invoke the java app (using Ajax request/response) I get the output to the div tag and the excel popup does not come up. Is this something special/different I need to do when using a div tag/Ajax?

View 2 Replies View Related

AJAX, Eval(), And Javascript Within Javascript

Apr 28, 2006

Ok so, this is my purpose:
- to be able to load asynchronously (via AJAX) some javascript ads (like google's or adbrite) so as to make them be loaded in the background, then update the page after the ads have loaded via innerHTML

Why?
-Because 90% of the time in my newer sites, javascript ads are the major offender in terms of speed of page rendering

My problem:
Via ajax, I can call a php file that retrieves some javascript and outputs it, XMLhttprequest returns those javascript lines, but they don't render in the page, since they miss the whole page loading, and are apparently not parsed
For example, let's say I call a php file via ajax, and it returns the output into a variable named "text" containing "document.write('hello')"
if I use xxx.innerHTML=text, nothing happens

My 1st solution:
Passing those javascript lines to eval() [like eval(text) ], but this produces a second problem, that I couldn't solve (probably because of my lack of knowledge in javascipt):
if I eval the code, it deletes my current page and renders a new one
for example, if I parse a document.write, my page disappears, and a new one is rendered with the document.write text

What I want is basically to make that "document.write" appear inside a div in my page, adding to the content (and not overwriting the whole page), much like what happens when using innerHTML

Is this even possible? How would you go about it?
I tried xxx.innerHTML=eval(outputfromphpfile) but it overwrites my whole page...

View 3 Replies View Related

Ajax Firing Off Javascript

Feb 8, 2006

I am using Ajax to refresh a DIV area by setting the
innerHTML=request.responseText in the usual manner. in the response text I
have a <SCRIPT> tag in line, but this is not executed. Is there a way of
making the ajax refresh process this.

View 11 Replies View Related

Ajax But Disable Javascript

Apr 12, 2006

If the browser disable the javascript, what happen to Ajax? can i slove
the problem by using server side script? any suggestion for this?

i currently do some dirty projects with perl/cgi, and I would like to
add more client side features which relate to ajax, and do some
validation on the client side with javascript. but it is possible that
the javascript may be disable with some browsers. what can i do if the
client's broweer disable the javascript.

View 8 Replies View Related

What Is The Differences Between AJAX And JavaScript?

Jul 26, 2006

Is AJAX built on top of JavaScript? What browsers supported AJAX?

View 6 Replies View Related

Getting Started With Javascript And AJAX

Aug 30, 2006

I'm interested in learning Javascript with an eye towards using it for
client-side user interfaces for web services, and I have a couple
questions.

First -- In reading some of the archives here, I've noticed a fairly
strongly held opinion that it is better to write purpose-built
Javascript than to use large libraries. Since this was what I was
planning on doing anyway, because of the size of the libraries and
compatibility quirks with Safari, it's nice to hear confirmation from
experts. That said, is the code in Prototype, Scriptaculous, and
OpenRico good enough to be worth reading and emulating?

Second -- I do much better with dead-tree references than with the
web, especially as a lot of the links that come up when I google for
Javascript topics are tutorials for the clueless by the clueless.
(Perl has the same problem, but with Perl I have enough knowledge to
filter the useful bits from the flat-out wrong bits.) Aside from the
O'Reilly Javascript reference (which I have) and _Ajax Hacks_ (which I
also have), are there other good references I should get my hands on?

View 1 Replies View Related

JavaScript As AJAX Response (RPC)

Oct 15, 2006

Some servers return JavaScript as the response to an AJAX request. When
the response JavaScript is eval'ed it calls other JavaScript functions
already in the browser to update elements, etc. This seems like a good
system because it allows so much freedom in creating the desired
behavior in the browser. The required data doesn't have to be converted
to XML or JSON on the server. The browser doesn't have to have
templates for interpreting and converting this data into some change in
the browser. All of the conversion algorithms don't have to be written
and changed when new behavior is required. This remote procedure call
approach is the predominant system in the Ruby on Rails world.
(Unfortunately they are calling Prototype.js functions.)

However apparently some people seem to think this remote procedure call
approach is a bad idea. I can't see why it is so bad because it is so
lightweight and flexible. It also helps to keep the client less
intellegent which seems good in a world of incompatible client-side
bugs.

If I use some neutral data format like XML to accomdate different types
of clients then I have to write different client-side interpreters for
each type of client (browser, RSS, POP, cell phone, etc). Why not just
write different server-side code that generates the correct JavaScript
(or other) for the requesting client type?

When is the RPC approach such a bad idea?

View 5 Replies View Related

Javascript In Ajax ResponseText

May 1, 2006

I'm making an ajax call to return the contents for a page using the responseText property. I want to be able to define a javascript function in the page and call it, doing something like:

<script>
function test(){
alert('hi');
}
test();
</script>

However, none of the javascript in my page works. I'd imagine it has something to do with it being included as part of the responseText and the browser is not picking it up. I haven't been able to find any info about this online anywhere. Any thoughts?

View 7 Replies View Related

Encrypt Javascript/ajax

Sep 28, 2006

Is any way to encrypt the javascrypt code ?

View 3 Replies View Related

Javascript On AJAX Request

Feb 16, 2007

I am currently creating a social network. On a profile if a user has comments they can delete them. I am running AJAX to update the database and display the comments refreshed (one deleted will no longer show). The data I am requesting includes the following...

<script language="JavaScript">
document.write("<a href="javascript:void(0)" 'CommentsTable', 'PostLink1', 'PostCommentText', 'ViewCommentsText')" id="PostLink1">Post Comment</a>");
</script>
<noscript>
<a href="comment.php?action=post&user=<?php echo $user; ?>">Post Comment</a>
</noscript>

My problem is that the JavaScript from the request does not work, I can only seem to display regular HTML. Is there a solution to this problem to make the JavaScript work or do I have to use an HTML alternative?

View 4 Replies View Related

Disabling JavaScript Ajax

Sep 26, 2007

If you have your site implemented in ajax, and client browser has disabled the javaScript, then ajax won't work?

Another question is, what if you are creating the page lay out(background color, boxes, etc) in javaScript, does it mean they also won't work?

View 1 Replies View Related

AJAX And Javascript Distinction

Dec 29, 2007

Is it just me, or is there no distinction between AJAX and Javascript nowadays? Today I saw a request for a calculator, something that should be done with just Javascript, but yet the post was seeking an AJAX developer. When did these terms become synonymous?

View 2 Replies View Related

Run JavaScript That Is Part Of AJAX Response

Apr 12, 2006

In my browser, I make an AJAX request. The server sends me a fragment
of an HTML document. That fragment has some JavaScript inside some
script tags. How do I run these scripts when the fragment arrives at
the browser?

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved