Search Results

Search found 314 results on 13 pages for 'unload'.

Page 1/13 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Kill unload function in JS?

    - by Newbie
    Hello! Is there a way to kill the unload function with javascript(jquery)? I am looking for something like this: window.onbeforeunload = function(){ confirm("Close?") } or in jquery: $(window).unload(function() { confirm("close?") }); Now, on window unload I get my confirm alert but it will continue in any case. Clicking cancel it won't stay on my page. Can U help me plz?

    Read the article

  • jquery window.unload triggers post after unload

    - by index
    I am trying to do a post to server before unloading a page and I followed this and it's working fine. My problem is the $.post on window.unload is triggered after it has unloaded. I tried it with a signout link and checking on my logs, I get the following: Started GET "/signout" for 127.0.0.1 at 2012-11-22 00:15:08 +0800 Processing by SessionsController#destroy as HTML Redirected to http://localhost:3000/ Completed 302 Found in 1ms Started GET "/" for 127.0.0.1 at 2012-11-22 00:15:08 +0800 Processing by HomeController#index as HTML Rendered home/index.html.erb within layouts/application (0.4ms) Rendered layouts/_messages.html.erb (0.1ms) Completed 200 OK in 13ms (Views: 12.9ms) Started POST "/unloading" for 127.0.0.1 at 2012-11-22 00:15:08 +0800 Processing by HomeController#unloading as */* Parameters: {"p1"=>"1"} WARNING: Can't verify CSRF token authenticity Completed 500 Internal Server Error in 0ms NoMethodError (undefined method `id' for nil:NilClass): app/controllers/home_controller.rb:43:in `unloading' First part is the signout and then user gets redirected to root then it runs the post ('/unloading'). Is there a way to make the '/unloading' execute first then execute whatever the unload action was? I have this as my jquery post $(window).unload -> $.ajax { async: false, beforeSend: (xhr) -> xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')) , url: '/unloading' , type: 'Post' , data: { p1: '1' } }

    Read the article

  • java unload static fields

    - by Alina Danila
    I have a java class that uses complex static fields which need special operations as close() so that they are safely cleaned by GC. For the initialization of static fields I use the static block. But I don't now how to unload the static field safely, so that I can call the close() method before the field is cleaned up by GC. Is there any way to unload a static field, similar to the static initialization block?

    Read the article

  • Unable to unload content in XML gallery - AS3

    - by Dimitree
    I have an XML gallery and I want in the next button function to "unload" all content and load new XML file. So far I use this code: function navigateToRight(evt:MouseEvent):void{ if (thumbsHolder.numChildren > 0){ while (thumbsHolder.numChildren) { thumbsHolder.removeChildAt(0); } removeloaded();} loadXml("2.xml"); } Where removeloaded function is loader.unload(); Unfortunately when i press next button I can see the new xml file is loaded but the items are from the previous xml file.

    Read the article

  • How to reliably send a request cross domain and cross browser on page unload

    - by Agmin
    I have javascript code that's loaded by 3rd parties. The javascript keeps track of a number of metrics, and when a user exits the page I'd like to send the metrics back to my server. Due to XSS checks in some browsers, like IE, I cannot do a simple jquery.ajax() call. Instead, I'm appending an image src to the page with jquery. Here's the code, cased by browser: function record_metrics() { //Arbitrary code execution here to set test_url $esajquery('#MainDiv').append("<img src='" + test_url + "' />"); } if ($esajquery.browser.msie) { window.onbeforeunload = function() { record_metrics(); } } else { $esajquery(window).unload( function(){ record_metrics(); } ); } FF aborts the request to "test_url" if I use window.onbeforeunload, and IE8 doesn't work with jquery's unload(). IE8 also fails to work if the arbitrary test_url setting code is too long, although IE8 seems to work fine if the is immediately appended to the DOM. Is there a better way to solve this issue? Unfortunately this really needs to execute when a user leaves the page.

    Read the article

  • Ajax request with JQuery on page unload

    - by Rob
    I'm trying to do this: $(window).unload( function () { $.ajax({ type: "POST", url: "http://localhost:8888/test.php?", data: "test", success: function(msg){ alert( "Data Saved: " + msg ); } }); alert (c); }); However, the success alert is never shown, nor does this request seem to be even hitting the server. What am I doing wrong? Thanks!

    Read the article

  • load/unload C dll with C# problems

    - by Goran
    I'm having problems with external native DLL. I'm working on ASP.NET 1.1 web application and have this DLL which I load through DLLImport directives. This is how I map DLL functions: [DllImport("somedllname", CallingConvention=CallingConvention.StdCall)] public static extern int function1(string lpFileName,string lpOwnerPw,string lpUserPw); [DllImport("somedllname", CallingConvention=CallingConvention.StdCall)] public static extern int function2(int nHandle); I call the dll methods and all works great, but I have problems with this DLL crashing my web site on some cases, so I would like an option to unload the dll after I use it. I found a solution at this link, but I don't have 'UnmanagedFunctionPointer' attribute in .NET 1.1 available. http://blogs.msdn.com/jonathanswift/archive/2006/10/03/Dynamically-calling-an-unmanaged-dll-from-.NET-_2800_C_23002900_.aspx Is there a way I can achieve what this guy did with his example?

    Read the article

  • Responding to the page unload in a managed bean

    - by frank.nimphius
    Though ADF Faces provides an uncommitted data warning functionality, developers may have the requirement to respond to the page unload event within custom application code, programmed in a managed bean. The af:clientListener tag that is used in ADF Faces to listen for JavaScript and ADF Faces client component events does not provide the option to listen for the unload event. So this often recommended way of implementing JavaScript in ADF Faces does not work for this use case. To send an event from JavaScript to the server, ADF Faces provides the af:serverListener tag that you use to queue a CustomEvent that invokes method in a managed bean. While this is part of the solution, during testing, it turns out, the browser native JavaScript unload event itself is not very helpful to send an event to the server using the af:serverListener tag. The reason for this is that when the unload event fires, the page already has been unloaded and the ADF Faces AdfPage object needed to queue the custom event already returns null. So the solution to the unload page event handling is the unbeforeunload event, which I am not sure if all browsers support them. I tested IE and FF and obviously they do though. To register the beforeunload event, you use an advanced JavaScript programming technique that dynamically adds listeners to page events. <af:document id="d1" onunload="performUnloadEvent"                      clientComponent="true"> <af:resource type="javascript">   window.addEventListener('beforeunload',                            function (){performUnloadEvent()},false)      function performUnloadEvent(){   //note that af:document must have clientComponent="true" set   //for JavaScript to access the component object   var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');   //var x and y are dummy variables obviously needed to keep the page   //alive for as long it takes to send the custom event to the server   var x = AdfCustomEvent.queue(eventSource,                                "handleOnUnload",                                {args:'noargs'},false);   //replace args:'noargs' with key:value pairs if your event needs to   //pass arguments and values to the server side managed bean.   var y = 0; } </af:resource> <af:serverListener type="handleOnUnload"                    method="#{UnloadHandler.onUnloadHandler}"/> // rest of the page goes here … </af:document> The managed bean method called by the custom event has the following signature:  public void onUnloadHandler(ClientEvent clientEvent) {  } I don't really have a good explanation for why the JavaSCript variables "x" and "y" are needed, but this is how I got it working. To me it ones again shows how fragile custom JavaScript development is and why you should stay away from using it whenever possible. Note: If the unload event is produced through navigation in JavaServer Faces, then there is no need to use JavaScript for this. If you know that navigation is performed from one page to the next, then the action you want to perform can be handled in JSF directly in the context of the lifecycle.

    Read the article

  • Unload event for the default AppDomain?

    - by Zor
    Hi, I need to have an event fired whenever any AppDomain unloads - including the default one of the process. The problem with AppDomain.DomainUnload is that it only fires for non-default AppDomains. Furthermore, AppDomain.ProcessExit has limited execution time, which I cannot rely on. Any suggestions as to how I can achieve this would be greatly appreciated! (Alternatively, having an event fired when a background thread (Thread.IsBackground == True) works too.) Thanks in advance.

    Read the article

  • Managing the Unload LPN Functionality for Inbound LPNs is as Easy as 1,2,3

    - by ToddAC-Oracle
    Resolve your WMS putaway issues as easy as one, two, three by using Doc ID 1479753.1 - How To Use The Unload Functionality for Inbound LPNs [Video]. You can review Doc ID 1479753.1 and see the easy setup steps and latest patches available to get the new Unload Functionality for Inbound LPN's. In the document, you can also review the short setup and demo video.The new functionality makes LPN clean up more robust, and makes it easier to work with LPNs that are in receiving and/or have missing/corrupted open move order lines or location discrepancies. Along with the original cleanup, you can work with stuck/pending putaway transactions for many common errors such as 'Invalid LPN', 'Unsuccessful Row Construction', 'Task Errored out', 'Online transaction failed', 'Unable to allocate space' while trying to receive, and inspect or putaway LPN's.So review Doc ID 1479753.1 and save hours by using the Inbound Unload Functionality for Inbound LPN's.

    Read the article

  • When to unload graphics object from main memory?

    - by piotrek
    I writing my resource mangaer, and I consider about how it can work for graphics objects (like textures, meshes). I think about this : I want to load texture (in pseudocode): Texture t = resMgr.GetTex("image.png"); and GetTex make something like this: load texture from disk to main memory create texture object (load it to gpu memory) unload texture from main memory I consider about 3 step, does game engines that you know unload meshes/textures after load them into gpu memory ?

    Read the article

  • XNA Load/Unload logic (contentmanager?)

    - by Rhinan
    I am trying to make a point-and-click adventure game with XNA, starting off simple. My experience with XNA is about a month old now, know how the classes and inheritance works (basic stuff). I have a problem where I cannot understand how I should load and unload the textures and game objects in the game, when the player transitions to another level. I've googled this 10 times, but all I find is hard coding while I don't even understand the basics of unloading yet. All I want, is transitioning to another level (replacing all the sprites with new ones). Thanks in advance

    Read the article

  • Trying to perform a series of actions on page unload, but the pages unloads too fast to finish them.

    - by user138821
    I have a series of actions I want to perform on page unload. Namely if a user is editing an input field, and they refresh or close browser or leave page, I want to save the contents of the field. The actions don't include an AJAX call, so I can't just make it synchronous. It's actually saving to local storage, but the page unloads before the storage can take place. The code is correct, if I add an alert to the actions, the delay allows the rest of the code to finish before it even displays. Any ideas? Thanks!

    Read the article

  • Memory leak when using Workflow 4.0 SqlWorkflowInstanceStore and PersistableIdleAction.Unload

    - by Rohland
    Hi, This particular problem is driving me nuts. I wonder if anyone has experienced a similar problem. If I load up a workflow then unload it and perform a memory snapshot then the result is predictable - my workflow is no longer in memory. However, if I load up a workflow and set the PersistableIdle action to PersistableIdleAction.Unload and let the workflow idle the workflow remains in memory even though the Unload action fires. I used ANTS Memory Profiler to debug this issue. This is the object retention graph outputted showing that an internal object is hanging onto my workflow instance. Can anyone else verify this problem? My code amounts to the following: Create SqlWorkflowInstanceStore and setup lock owner handle -- At this point I take a memory snapshot Create an instance of Workflow1 Set the PersistableIdle action Apply the instancestore to Workflow1 Setup action event handlers for Idle, Unload, UnhandledException etc. Persist the workflow instance Run the workflow instance Wait for instance to idle (caused by Delay activity) Ensure the Unload action is fired -- At this point I take a second memory snapshot From the above image, it is clear that the only object referencing Workflow1 is some internal event handlers result which I have no ability to dispose of. Any clues?

    Read the article

  • Firefox: Unload a tab manually

    - by unor
    Firefox has a setting "Don't load tabs until selected" (see How do I make Firefox 13 Load All My Tabs on Startup or when Resuming Reload). I like that behaviour. I am searching for a way to "deload"/deactivate a tab manually for a session (until I reload it). It should stop all running JavaScript functions and plugins (like Flash). The whole webpage content may disappear until I reload/re-activate the tab, but that is not a requirement. The title has to be displayed as tab label (like it is the case with the startup setting, too). The workaround would be to restart Firefox and don't switch to the tab I want to be deactivated. This is pretty annoying, of course. EDIT: Here is what I found so far (thanks, @bytebuster!) BarTab no longer being maintained (see why) BarTab Lite seems to miss this functionality from BarTab Dormancy experimental; comes with warning that it "may eat your session" Tab Mix Plus Feature request: Unload Tab feature Tab Utilites seems to offer this functionality only for automatic unloading Feature request: Add "unload tab" to tab context menu. UnloadTab removed from addons.mozilla.org (who knows why)

    Read the article

  • Windows 7 unload driver/disconnect usb before restart

    - by brux
    In xp, my Tascam US 122 usb audio interface works fine. On my windows 7 computer the device works, however when i restart/shutdown it hangs at the "shutting down" screen forever. If the usb cable is removed prior to initiating restart/shutdown then everything goes fine, the computer restarts as normal. This is a known problem, running any other driver in compatibility mode doesnt fix the problem. Is there a method I can use to unload the device/drivers so that I dont have to reach round physically and disconnect the cable. Somebody suggested a spdt switch on the cable itself, but I am looking for a simpler method. Surely I can automate the unloading of the device through a script or such? Any ideas are greatly welcomed thanks

    Read the article

  • jQuery events .load(), .ready(), .unload()

    - by Eric
    Hi folks, Just a simple question, for the jquery event. Are the .load(), .ready() and .unload() run in order when the DOM is loaded? The answer seems yes when I see the jQuery Documentation. <script type="text/javascript"> $(window).load(function () { // run code initializeCode(); }); $(document).ready(function() { //run code that MUST be after initialize }); $(window).unload(function() { Cleanup(); }); </script> However, the code inside the .ready() is execute before the initializeCode(); is execute, so I feel really strange. And now I have to place my code inside the .onload() method and just after the initializeCode(); line, which means to be inside the .ready() block. Could someone explain me more about this, as I am new to jQuery. Thank you so much.

    Read the article

  • How to Unload a popped view controller?

    - by RexOnRoids
    Using a navigation based view hierarchy. I have a root view controller, and multiple view controllers that branch out from the same when a button is pressed. When a user presses the back button on the UINavigationBar, the current viewcontroller is popped and the display animates back to the rootviewcontroller. The problem is, I want the viewcontrollers to UNLOAD whenever they are popped. Seems like they are not unloading because when I go back to them they are still in the state they were when they were popped. How do I unload the viewcontrollers after navigating back to the rootviewcontroller?

    Read the article

  • How to unload JVM from a living process?

    - by Guy
    Hi, I'm working with JNI and trying to unload (destroy) the VM using DestoryJavaVM function (I first call DetachCurrentThread method). It seems like the it has now influence on the VM and it is still up after the call. I read in old Sun posts that DestoryJavaVM had problems in the past (JDK1.1-1.3 in 2001) but I'm using JRE 6 and it probably should work now, right? I need to Load\Unload a VM in the same living process since each loading requires another classes to load. Any ideas how it can be done? Thanks, Guy

    Read the article

  • how can I unload a swf with AS3?

    - by Ole Media
    Any body can help on how I can do to unload a swf before I load the next one? var mLoader:Loader = new Loader(); function loadSWF(e:Event):void { var imageId:Array = e.target.name.split("_"); var targetId:int = imageId[0]; var caption:int = imageId[1]; txt = arrayText[caption]; dynText1.text = ""; dynText1.text = arrayText[caption]; dynText1.setTextFormat(textFormatMain); var swf:String = "swf/" + xmlList[targetId].image[caption].@swf; if (mLoader.content != null) { swfLoad.swfArea.mLoader.unload(); swfLoad.swfArea.mLoader.load(null); } mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); mLoader.load(new URLRequest(swf)); } //-------------------------------------------------------------------------// function onCompleteHandler(loadEvent:Event):void { swfLoad.swfArea.addChild(loadEvent.currentTarget.content); TweenLite.to(swfLoad, 0.5, {alpha:1}); } function onProgressHandler(mProgress:ProgressEvent):void { //var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal; //trace(percent); }

    Read the article

  • AppDomain.Unload doesn't release the assembly I loaded up with Reflection

    Hi All, I am struggling with an issue while loading an assembly up in a temporary AppDomain to read its GetUsedReferences property. Once I do that, I call AppDomain.Unload(tempDomain) and then I try to clean up my mess by deleting the files. That fails because the file is locked. I Unloaded the temporary domain though! Any thoughts or suggestions would be greately appreciated. Here is some of my code: //I already have btyes for the .dll and the .pdb from the actual files AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationBase = Environment.CurrentDirectory; domainSetup.ShadowCopyFiles = "true"; domainSetup.CachePath = Environment.CurrentDirectory; AppDomain tempAppDomain = AppDomain.CreateDomain("TempAppDomain", AppDomain.CurrentDomain.Evidence, domainSetup); //Load up the temp assembly and do stuff Assembly projectAssembly = tempAppDomain.Load(assemblyFileBuffer, symbolsFileBuffer); //Then I'm trying to clean up AppDomain.Unload(tempAppDomain); tempAppDomain = null; File.Delete(tempAssemblyFile); //I even try to force GC File.Delete(tempSymbolsFile); Anyway, the Deletes fail because the files are locked still. Shouldn't they be released because I Unloaded the temporary AppDomain?!?!?! Thanks in advance, Dan

    Read the article

  • Jquery, FadeIn before unload

    - by Starboy
    I'm trying to accomplish a transition effect if you will. On doc ready div fades out, the problem im having is when a visitor navigates away from the page (or .unload) I want the div to fade back in. $(document).ready(function(){ $('#overlay').fadeOut(2000, 'easeOutQuad'); }); $(window).beforeunload(function() { $('#overlay').fadeIn(2000, 'easeOutQuad'); });

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >