I use ajax on my site for navigation but I'm having a problem with script tags in my pages. (My app is a Rails app but I don't think that makes a difference)
For example, I have a button on my page:
<button id="alert">click here</button>
and at the bottom:
<script>
$("#alert").click(function() {
alert("hi there")}
);
</script>
The first time I go to the page, the button works fine. Then, I click around a few links on my Ajax site, go back to the page called with Ajax, and it doesn't work anymore. I heard before 'Ajax strips out the tags' or something, but haven't come up with a solution.
Would eval() work? Heard it might do it. How would I implement? I've been working at this for days now and it seems strange there's no simple work around.