Side navigation
#777 closed bug (fixed)
Opened January 11, 2007 12:00AM UTC
Closed July 20, 2007 10:01PM UTC
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: | |
Blocked by: | Blocking: |
Description
<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();
}
Attachments (0)
Change History (3)
Changed January 14, 2007 07:53PM UTC by comment:1
milestone: | 1.1 |
---|---|
priority: | trivial → minor |
version: | 1.1 |
Changed July 20, 2007 09:49PM UTC by comment:2
description: | <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();\ }\ \ → <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(); \ } \ \ |
---|---|
milestone: | → 1.1.4 |
need: | → Review |
owner: | → john |
version: | → 1.1.3 |
Changed July 20, 2007 10:01PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | new → closed |
Fixed in SVN rev [2428].