M
M
MuradMM2019-06-13 01:21:52
JavaScript
MuradMM, 2019-06-13 01:21:52

How to get users.get vk api by entering link in input?

I want to get users.get data by entering a link to the VK page in the input without a button and refreshing the page. Here is a clear example in the photos or a link to the direct source:
Link to the source
5d01796a186bd789140893.png
5d01797bc1a28756922647.png
5d017982e81ee647839178.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Shohruh Shaimardonov, 2019-06-13
@joeberetta

elem = document.getElementById('inputId');
elem.onchange = function() {
//Работайте с users.get внутри этой функции. 
//сработает при изменении значения инпут
//для сокращения количества запросов в users.get можете также здесь сделать if() с
//парсингом строки: если строка начинается
//с "vk.com/" то начать запрашивать users.get.
//До тех пор просто слушать
}

A
Andrey Tokmakov, 2017-07-25
@knocker83

alternatively make 2 inputs transparent, wrap them with a div and style it as a single input field and you will be happy.
Something like this https://jsfiddle.net/xNPC/de4wt59g/

Z
Zombie42679, 2017-07-25
@Zombie42679

Here it is conveniently painted i-leon.ru/udobnoe-pole-input-dlya-telefona

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question