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

  • SEARCH
  • Home
  • 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 8690485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:54:45+00:00 2026-06-12T23:54:45+00:00

Is it possible for a visitor to a page to run an arbitrary function

  • 0

Is it possible for a visitor to a page to run an arbitrary function specified in the javascript for that page from their browser?

For a simple example, if the page has a function to hide a particular element when a button is clicked, can a visitor trigger that function and hide the element without clicking the button, but by calling the function directly somehow?

  • 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-06-12T23:54:46+00:00Added an answer on June 12, 2026 at 11:54 pm

    Yes, the user has full control of the DOM. However, it is possible to reduce what can be accessed by using closures. For instance, if I have:

    (function() {
        var myvar = "can't touch me!";
        // do stuff with myvar
    })();
    

    Then there is no way for the user to get at or change the string. Similarly for functions, unless you make them global variables (or attach them to the window object). Any property attached to the DOM is accessible too, such as the onclick attribute of elements. However if you use the addEventListener method then I don’t think there’s any way to find it.

    Overall, the browser can’t be trusted.

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

Sidebar

Related Questions

Is it possible to track visitor that leave or page to another sites, like
I have a very simple one page website that has a input field in
Is it possible to check if the visitor is still online using their IP
Is it possible that some javascript or jquery can handle this: I have an
is it possible to redirect a visitor on my php page as soon as
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: JavaScript: why does parseInt(1/0, 19) return 18? Why does parseInt(1/0, 19) evaluate
Is it possible to report the time spend on a page back to server
I have an iframe that loads a page that I would like to disable

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.