/    Sign up×
Community /Pin to ProfileBookmark

Javascript "Packages" object is not being recognized by browser

I am trying to use “Packages” object of javascript in order to access java classes directly from javascript. I have seen many examples from different sites and resources. But when i try to run any example in may application, i find javascript error “Packages is undifined”.

A sample line from my code is like,

[B]var javaDate = new Packages.java.util.Date();[/B]

I tried this using IE 6 and 7, but same encountered with same problem.

Waiting for a quick response, its urgent!!!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 28.2007 — You can not use Java in JavaScript. Java executes on the server, JavaScript on the client. They do not execute at the same time.

You can use JavaScript's Date() object.

Eric
Copy linkTweet thisAlerts:
@ELcucuiMar 31.2007 — i have the new windows vista and my computer says that javascript is turned off how do i turn it on?
Copy linkTweet thisAlerts:
@JMRKERMar 31.2007 — Whisper in its ear?
×

Success!

Help @nasir-techno spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...