Reputation: 389
I need some way to replace
with
using JS. The page is generated dynamically and now we need some one-off half-semester classes added.
Does anyone know how to swap these URLs with something I can just toss into the footer.
Upvotes: 0
Views: 61
Reputation: 9273
It sounds like you want a script you can drop in to your page which will dynamically change some of the hyperlinks. Since your page is already loading jQuery, this should do the trick:
<script>
$('a[href="https://stusys.harpercollege.edu/class-schedule/class-schedule.html?course=0008&subject=LAG&term=202095"]').each(function(){
$(this).attr('href', 'https://stusys.harpercollege.edu/class-schedule/class-schedule.html?course=0008&subject=LAG&term=202090' )
})
</script>
Upvotes: 0
Reputation: 46602
Use URL():
var url = new URL('https://stusys.harpercollege.edu/class-schedule/class-schedule.html?course=0008&subject=LAG&term=202095')
url.searchParams.set('term', 100)
console.log(url)
Upvotes: 1