Paul McLanahan wrote:
> This would call $.eval implicitly at certain times and in certain
> browsers when we don't expect it, which could possibly override global
> variables or functions which we also aren't expecting.  So my proposal
> above of $.geval() for "global eval" was intended to avoid this
> possibility.  I may be being paranoid, but I can imagine that a bug
> that involved eval being unexpectedly global might be very hard to
> track down.
  I haven't been able to follow this thread entirely, but believe this 
relates to an problem I came across @ 4 days ago when trying to execute 
javascript that was part of the HTML $.load()'ed into the DOM.

 Specifically, the $.load() call returned some HTML resembling

---[BEGIN LOAD]---
<a href="#" onclick="newFunc()">click me</a>
...
<script type="text/javascript">
function newFunc() { alert('worked'); }
</script>
---[END LOAD]---

When the loaded "click me" link was pressed in FF/Opera, I would receive 
the "worked" alert. I couldn't get it to work in IE... and thought maybe 
it had to do w/ the getScripts() function called upon the $.load()'ed 
content. After examining this with IE, it appeared to be executing the 
code, but the declared functions were not available. Thus I thought it 
was a scoping thing.. and was able to get around the issue via something 
like;

---[BEGIN LOAD]---
<a href="#">click me</a>
...
<script type="text/javascript">
$('[EMAIL PROTECTED]').click(function(){ alert('worked'); });
</script>
---[END LOAD]---

So pardon my naiveness... but would your fix essentially alleviate the 
scoping issue and allow functions declared @ ajax loaded content to be 
available (globally) to IE?

Gratzie!

~ Brice



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to