question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

button's function call not working.

See original GitHub issue

Meta info

  • Seems to be a bug:
  • Version (3.6.2): The version is no longer displayed in the help section.
  • Context - Chrome extension:

Greetings,

<button onclick="CallFunction()">Click me</button>

Does not seem call the function.

The CSS panel recognizes the button and can be styled and reacts like an active button is programed to do except for implementing the HTML portion of the code.

Entering the code without a function call does implement the code. (See example below.)

Other variations such as:

<button onclick="Alert()">Click me </button>

or

<button onclick="counter=counter + 1">Click me </button>

similarly, do not run the requested code.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
CodeThePeacecommented, Mar 19, 2019

Pleased to report, this issue was resolved in the newer version ( 4.0 )

0reactions
chinchangcommented, Mar 19, 2019

As you have already noticed, your code will work inside the Web app. But not in Chrome extension due to security restrictions in browser extensions. In chrome extension, in the HTML panes you can write JavaScript or use event attributes like onclick etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button onclick not calling function - javascript - Stack Overflow
Try to put function inside the <head> section of the page and if worked, The problem is wrong path to js file. Share....
Read more >
Not being able to call a javascript function through a button
The code in my solution works absolutely fine. If it's "not working" for you, then you need to provide a meaningful description of...
Read more >
onclick Event - W3Schools
Execute a JavaScript when a button is clicked: <button onclick="myFunction()">Click me</button>. Try it Yourself ». More examples below.
Read more >
How can I call a function from a custom button in - ServiceNow
Solved: Hi, I have a UI script that adds a button next to user info dropdown on the header of the admin page....
Read more >
HTML Button onclick – JavaScript Click Event Tutorial
In JavaScript, you invoke a function by calling its name, then you put a parenthesis after the function identifier (the name).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found