Well, I am using ASP.NET MVC with jQuery. I DO NOT use partial view (ascx) for this part of the application, instead I drink the full view, but load them into divs. Therefore, I have a basic view with the head with some reference to the js file, which is the client-side logic for this "type" of the view. When you click a tab on this view, we use jquery tabs to load the "antoher view" into some div. Tab paths are loaded using this plugin by simply specifying the URL (instead of using the load to which, as indicated, I could add a callback function, rather than relying on availability).
But. I donโt want ALL client logic to be in some parent view, since any view should be able to load another view by url (routines include a link to the associated js file, which contains all the logic for formatting / connection at boot).
What REALLY confusing now is that it works in some situations and not in others; for example, 1) when the parent view is opened in a frame in IE, ready files in the view never run 2) when the same URL is opened directly in IE, readys routines are launched 3) when the same URL is opened in FFX2, ready each one does NOT start 4) finally .. but when you open the sub-heading (which has sub-items) of this parent in FFX2, the child readiness event fires! .. is puzzled ..
I am going to run some tests and I will get back to you, but any suggestions as to why this behavior may be different will be highly appreciated
UPDATE: Ah, ha! .. it looks like even with the obstacles eliminated above the difference is in the browser (obviously from reading above). below a simple test works fine in IE7, but does not work in FFX2. The finished event is fired in IE, but not FFX, when Test2.htm is loaded into Test1.htm. From experience, I know that this means that IE has a โquirk,โ and FFX works the way you expect, based on W3C. So it looks like this approach is not if anyone has no suggestions?
test1.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script type="text/javascript" language="javascript" src="Scripts/jquery-1.3.2.js"> </script> <script type="text/javascript" language="javascript"> <!-- $(document).ready(function() { alert("Test1.htm"); $("#Test1").load("Test2.htm"); }); </script> </head> <body> <h3>SOME TEST</h3> <div id="Test1">EMPTY</div> </body> </html>
Test2.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script type="text/javascript" language="javascript" src="Scripts/jquery-1.3.2.js"> </script> <script type="text/javascript" language="javascript"> </script> </head> <body> <h3>SOME TEST</h3> <div id="Test2">EMPTY</div> </body> </html>