0
I have the following function:
$(document).ready(function(){
arrayAmount[0]='29.90';
}
I need, instead of specifying the value directly there (29.90), it gets the value of a URL.
Ex:
arrayAmount[0]=GET:http://domain_here.com?id=1;
How can I do that?
I need something that is in only one command/line, as there will be several array
..
In fact what I need is for it to take the value that the URL returns in JSON, that is, the value is returned only when the URL is accessed. The
id=1
is a plan reference, for plan has a different value.– Wendler
If JSON is being passed to the url by GET, just do the same, but using the JS function to convert to JSON
var obj = JSON.parse($.urlParam("json");
– João Victor Souza
Actually it is not in JSON, it is only in plain text. When access to the URL is displayed on the screen only one value, for example: 79.90
– Wendler
In that case your tip will work too?
– Wendler