Maybe a stupid question, but how do I implement this js.script in anvil?
This should help.
To implement this particular solution, you can just add this js code to your Native Libraries in Anvil Editor and call it as mentioned in the post
Thank you very much, but I get always the error in my āeditFormā:
attributeError: āeditFormā object has no attribute ācall_jsā
Actually you will need to replace that line with anvil.js.call
import anvil.js
anvil.js.call("copyclip", self.lbl_odscode.text)
import anvil.js
def btn_chrcopy_click(self, **event_args):
anvil.call_js("copyclip", self.lb_id.text)
but I still get the error
AttributeError: module āanvilā has no attribute ācall_jsā
import anvil.js
def btn_chrcopy_click(self, **event_args):
anvil.js.call("copyclip", self.lb_id.text)
Itās anvil.js.call
, not anvil.call_js
OK thank you, sorry my mistake. It is working fine now.
Only 1 question : I added your js.script to the standard-page.html page of this app. Is this OK?
The Native Libraries section is the best place for your custom Javascript and CSS. That way if you replace the standard page HTML with another one to change the look and feel, you donāt need to worry about your custom Javascript.
OK thanks for this quick reply.