[Koha-bugs] [Bug 25639] Add search queries to HTML so queries can be retrieved via JS

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jul 29 03:22:27 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25639

--- Comment #10 from David Cook <dcook at prosentient.com.au> ---
(In reply to Nick Clemens from comment #9)
> In javascript we would need to make it a global variable

Yes, but that's not bad.

Traditionally, Javascript only had Global Scope and Function Scope. They've
only added Block Scope recently via the "let" and "const" keywords with ES2015. 

We have lots of global variables in our Javascript.

Technically speaking, an HTML element with an ID element is accessible as a
Javascript global variable. (If you want to test that, open your F12 tools, go
to console, and type in "console.log(add_comment)" on this page. It'll return a
div element. 

> we have other
> instances in the code of placing useful information in the HTML
> (loggedinbranch etc.)

I don't see any examples of loggedinbranch in HTML specifically, but happy to
look at examples. Perhaps it's needed in the HTML to be POSTed elsewhere. 

If it isn't needed in the HTML per se, I'm not sure inertia is the best reason
to continue doing something.

But I don't think it's a blocker. Just a thought.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list