Login Register


Help with JavaScript and JSON filter_list
Author
Message
Help with JavaScript and JSON #1
I have a script that uses a api to query a results page. The results are in JSON and i want to ask for a object in JSON, get the data, change the value and use in a http request.

The problem is that i don't know how to change the object value. Here is a snip but it's giving error...
Code:
for (x in myObj.items) { var str = ""+ myObj.items[x].link +""; var res = str.replace(""+ myObj.items[x].displayLink +"", ""); var res = str.replace("http://", ""); var res = str.replace("https://", ""); var res = str.replace("/wws/info/", ""); document.write(''+res+'\n'); }

The myObj.items[x].link is something like
http://website.com/wws/info/test123

And i want as a string test123. Both domain and path are random and can be removed.

Thanks
(This post was last modified: 11-17-2019, 06:30 PM by hacxx.)

Reply





Messages In This Thread
Help with JavaScript and JSON - by hacxx - 11-17-2019, 06:28 PM
RE: Help with JavaScript and JSON - by hacxx - 11-17-2019, 10:32 PM



Users browsing this thread: 1 Guest(s)