The task is to make clickable div tags. There are several div blocks in a page, each div contains a hyperlink with URL. You need to make so, that if you click on div element, you open a hyperlink.
(read more...)The task is to make clickable div tags. There are several div blocks in a page, each div contains a hyperlink with URL. You need to make so, that if you click on div element, you open a hyperlink.
(read more...)Javascript never had good ways to use multiline strings before ES6 had appeared. In ES6 you can use template literals – strings delimited by backticks instead of quotes, single or double. But what to do if you can not use ES6 possibilities?
(read more...)In SharePoint queries you should use date in the format 'yyyy-mm-ddTHH:MM:SSZ', for example, 2019-09-30T09:00:00Z. But the input form of the SharePoint datetime controls returns the value as 'dd.mm.yyyyy', the time value you will recieve in another way.
(read more...)I made a simple HTML page with JQuery UI tabs. But the customer asked to give URLs for each tab. I was a bit surprised with it, because I remember only how to make default tab on page load. You can do it with the syntax like this:
$("#tabs").tabs( { selected: x });
where 'x' is integer index of tab. So, the task was to determine which tab is requested.
(read more...)Snippet for AngularJS for working with checkbox controls. The task is to verify if checkbox is checked or not with AngularJS.
The syntax of jQuery code how to retrieve radio button items in cycle. For example, you have radio buttons with names, first you need to get them to array. For this case I will do it manually.
There's a control <select> on your page and you want to use it's value as selected and don't want to allow user to change it. Unfortunately, there's no attribute "readonly" for select as for <input> ones. You can use only attribute "disabled", but in this case its value will not be sent. But there's a trick how to do it.
Some notes about creating visible and invisible buttons in Knockout.js.
There's an equivalent in jQuery to PHP function print_r($array). It's good when you want to see an associative array. Especially, if you get it via some function.
Useful snippet for debugging javascript. It prints out key-value pairs of associative array. In PHP your have function print_r($array), but in Javascript you still have to make your own function.