Ticket #777 (closed bug: fixed)
evalScripts() runs embed js befor previous external code
| Reported by: | butterbrot | Owned by: | john |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.1.4 |
| Component: | ajax | Version: | 1.1.3 |
| Keywords: | eval external javascript order | Cc: | |
| Blocking: | Blocked by: |
Description (last modified by john) (diff)
<script type="text/javascript" src="alert_hello.js"></script>
<script type="text/javascript">
alert("I dont know any 'alert_hello.js' function");
</script>
ALERT[I dont know any 'alert_hello.js] ALERT[Hello]
none-optional-solution:
evalScripts: function() {
var rv = function(html,rv){
if ( this.src ) { for some weird reason, it doesn't work if the callback is ommited
jQuery.getScript( this.src , function(source) {
html.find('script:first').remove().end(); html.find('script').each(rv,[html,rv]).end();
}); return false;
} else {
jQuery.globalEval( this.text this.textContent this.innerHTML "" ); }
} return this.find('script').each(rv,[this,rv]).end();
}
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
