Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to send array in query string in javascript

myArray = ['1', '2', '3'];
var arrStr = encodeURIComponent(JSON.stringify(myArray));
window.location = url + '/?id='+id + '&type=' + myArray;
Comment

PREVIOUS NEXT
Code Example
Javascript :: filter array of objects to remove duplicate keys 
Javascript :: js functions inside of objects 
Javascript :: play audio in javascript 
Javascript :: javascript get first character of string 
Javascript :: javascript get file extension from string 
Javascript :: jquery observe class change 
Javascript :: How to iterate over the DOM 
Javascript :: image not showing js 
Javascript :: number format in javascript 
Javascript :: js alert 
Javascript :: javascript remove clicked table row from table 
Javascript :: how to change active tab jquery 
Javascript :: Vanilla JS (on)load with page 
Javascript :: how to get last element of array 
Javascript :: replace all dashes to slashes using jquery in a string 
Javascript :: Exceeded timeout of 5000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 
Javascript :: npm react-native-async-storage 
Javascript :: system collections generic list to javascript array 
Javascript :: jquery remove keypress event 
Javascript :: vue get props into data 
Javascript :: node json db example 
Javascript :: eslint ignore file rule 
Javascript :: atob nodejs 
Javascript :: search content in js 
Javascript :: split string on multiple characters javascript 
Javascript :: useState settoggle 
Javascript :: prodigy math game add item by id 
Javascript :: react toggle boolean state 
Javascript :: javascript add button to div 
Javascript :: jq object to dom object convert 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =