When I use .load() to pull in a whole page, script tags are correctly pulled in and executed. However, if I add a selector to the .load() call all script tags get stripped out. In the following example, the heading from the second HTML file gets pulled in, but the JS with the alert does not. Could this be a bug?
<html> <head> <title>Ajax</title> <script type="text/javascript" src="jquery-1.2.6.min.js"></script> </head> <body> <div id="load_target"></div> <script type="text/javascript"> $("#load_target").load("has_script.htm #script"); </script> </body> </html> <html> <head> <title>Script</title> </head> <body> <div id="script" > <h1>Heading</h1> <script type="text/javascript"> alert('Hi'); </script> </div> </body> </html> -- View this message in context: http://www.nabble.com/Partial-load-strips-out-script-tags--tp19830989s27240p19830989.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.