Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Browsing all 140734 articles
Browse latest View live

How to input image file from user and then base64 encode it in javascript?

I trying to take image as a file input from the user and the display it as a base64 encoded string. Here's my code<!DOCTYPE html> <html> <head> <title>JavaScript – Convert Image...

View Article


Javascript - Determine if array should have index set, a new index added, or...

I'm trying to update an array periodically from an API.Essentially I have my existing array (what was kept from before the update), and then the new array which I am comparing it to, from the API.What...

View Article


Can I tell my php function to not execute until the "file_get_contents" has...

This is my php function:$result = file_get_contents('https://www.example.com/index.php'); $regex = '/<img class="pic" src="(.*?)">/'; preg_match($regex, $result, $matches); return($matches[1]);...

View Article

Vue js + Vuetify autocomplete using Yandex Predictor API

I use Yandex autocomplete words API in my vue js application. Here you can see my codepen example. Autocomplete work when I enter one work for example hell on response get hello. But when I enter hello...

View Article

Jquery noConflict is not working in asp.net master page

I have added below two scripts in master page but full calendar is working fine on clicking of below button boostrap model pop will appear but is not working<a href="#" class="">...

View Article


Why is the 'arguments' property on the function object null?

Code:function foo(a, b, c) { console.log('hi'); } console.log(foo); Output: (expanded)foo(a, b, c) arguments: null caller: null length: 3 name: "foo" prototype: Object {...} <prototype>:...

View Article

Dynamic Variable name construction in js using Lodash or es6

Instead of referring fields[0] fields[1], Someone help me to construct dynamically//fields =['string1','string2'] createNestedSubDoc(id, body, fields) { return this.model.findById(id).then(doc => {...

View Article

ArrayBuffer and Float64Array in Swift

I'm trying to convert one of the javascript functions into Swift 5 function. But even after so much of extensive search I couldn't find anything on it. function toArrayBuffer(type, ts, x, y, z, sc) {...

View Article


Search number of characters in Javascript using regexp [duplicate]

How do you find the first 4 characters/letters in this string using regexp? In this case , how to find SPAS?var str = "SPASIAL1-40"; i'm confused whether to use /\w/g or /\d{4}/g

View Article


Django Ajax Post with HTML content using JSON.stringify then json.loads error

I have a textarea within a form on a webpage that has "HTML" content.<!-- HTML --> <textarea id="my-textarea"> <div class="this">Content here &amp; here!</div>...

View Article

create database with the help of php coding [closed]

I want the PHP code which creates the database table and coloum.

View Article

Sync local files with remote

I use node.js, and I want to sync my local dirrectory with remote one.For example: I have a remote folder with files something like this: https://nodejs.org/download/release/v13.5.0/I also have a...

View Article

Laravel auto-login when visiting to website again

Hi i Hope you all are fine.. i'm new to laravel. I want that if once user is logged in after successful registration to website and visit my website after sometime or some days even every time of visit...

View Article


Regex.test() returning false on a seemingly valid string [duplicate]

Im trying to use a regular expression to validate a phone number in Javascript. The expression im using is: /^\d{3}-\d{3}-\d{4}$/ I've tested the expression using this website: https://regexr.com and...

View Article

Is it unsafe to invoke a function by it's name as a string using the window...

Would you please tell me if there is anything unsafe, in the JS of a standard web page, about invoking a function by it's name as a string using window['function_name']()? I remember reading something...

View Article


Data not evaulating in react native

I am trying to evaluate data and display it here is my code. i have dummy data and i broke it up with the meal.jsthe error is TypeError undefined is not an object (evaluating...

View Article

Pure JavaScript AJAX Call In WordPress Custom Plugin Development

I am developing a Custom WordPress Plugin in which I have some HTML form on the main plugin page and a back page where I have some functions in PHP like to get information from the database etc. To...

View Article


Javascript Promises: Chain same promise n times, then do something else

I have a promise-returning function that does some async stuff, let's call it functionToRepeat().I am trying to write the function repeatFunction(amount) , so that it will start the promise, wait for...

View Article

Can't change img and nicknames picked from steamapi

Basically i need to sync some images and nicknames using this:https://www.npmjs.com/package/steamapii'm pretty new to promises and i got to this point,my code: const SteamAPI = require('steamapi');...

View Article

Why JavaScript removing decimal values when using or operator? [duplicate]

If i use or operator with a decimal number the decimal points gets cut off from the outputconsole.log(2.5|0) it prints 2console.log(5|0) it prints 5console.log(1000.1|0) it prints 1000Why is that?

View Article
Browsing all 140734 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>