Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Björn Norén
Björn Norén
9,569 Points

Ajax: How do I update the url in .open(method, url) ?

Hi, sry if this is a very basic question but I have this url where I can get data based on the ID:{} that I choose for the url: http://api.arbetsformedlingen.se/af/v0/platsannonser/matchning?lanid={}

So the question is: based on that a User can choose an value for the ID, how do I update {*} for the url without reloading the page?

1 Answer

Björn Norén
Björn Norén
9,569 Points

Hi, I did find a solution to the problem. It was enough to add a EventListener there you could use a recieved input as ID whenever a user clicks something, and since an EventListener reloads everytime it's clicked it solved the updating of the url.