Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6118129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:24:01+00:00 2026-05-23T15:24:01+00:00

For example if you type in the browser bar javascript:alert(‘hai’); it shows a pop

  • 0

For example if you type in the browser bar javascript:alert('hai'); it shows a pop up. Is that possible to do in a programming language?

For example in java would I be able to connect to a website, and execute it’s javascript somehow in my program?

Example:

Javascript in website:

function setStatus(a) {
    if (a == 1) status1 = true;
    else if (a == 2) status2 = true;
    else if (a == 3) status3 = true
}

Java program:

URL site = new URL("http://somesite.com/page.html");
URLConnection siteConnect = site.openConnection();
siteConnect.connect();

Would I be able to execute setStatus(1) setStatus(2) setStatus(3) inside the java program? How could it be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:24:01+00:00Added an answer on May 23, 2026 at 3:24 pm

    You’re looking for an environment that includes both a Javascript engine and the browser DOM and JS builtins; therefore your easiest bet is going to be something like a browser.

    First stop for you should probably be HTMLUnit , which has Javascript support via Rhino and provides all the browser-specific JS objects. That may be everything you need.

    If you want to go deeper, you could hook into a full browser engine by developing against Webkit. Two ports to look at are QtWebkit (if speed is not a criteria for you) or Google’s Chromium. Beware that setting either of those up will be a time investment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to use multiple header types in one document? For example: header(Content-type:
How can i detected the browser type in my silverlight application? for example i
I'm creating a web-browser type app (using a web view object) that needs to
How to automatically replace url in browser address bar with JavaScript from   company.com/en/ services/
Getting started with jquery and having trouble getting hello world type example going for
I have C header file containing the following type definition: // example.h typedef struct
For example, given a type param method i'm looking for something like the part
For example, if you type something in upper-right google/yahoo search box in firefox there
The Java data type byte for example holds data from -128 to 127 in
I have a custom c# type like (just an example): public class MyVector {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.