As it does with JavaScript as well, see
www::mechanize reloading page, so you'd remove a line (or a part of it) to stop JavsScript from loading another page.
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.