Search Results

Search found 818 results on 33 pages for 'onload'.

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

  • Is it possible to detect the load of an applet?

    - by zneak
    Hello guys, I'm working on a Safari extension, and I'd like to detect when <applet>s load on a page. However, there seems to be no onload event for these. How should I do it? Transform all <applet> tags to <object> tags and then intercept their onload events? Is there a better way?

    Read the article

  • Hook a javascript event to page load

    - by Jagd
    I have an aspx that has the following javascript function being ran during the onload event of the body. <body onload="startClock();"> However, I'm setting the aspx up to use a master page, so the body tag doesn't exist in the aspx anymore. How do I go about registering the startClock function to run when the page is hit and still have it use a masterpage?

    Read the article

  • Adding/removing session variables on Page OnInit/OnLoad in C#

    - by MKS
    Hi Guys, I am using C#. I am having below code in C#: protected override void OnInit(EventArgs e) { try { if (Session["boolSignOn"].ToString() == "true".ToString()) { lblPanelOpen.Text = Session["panelOpen"].ToString(); } else { lblPanelOpen.Text = Session["panelOpen"].ToString(); } } catch (Exception ex) { Logger.Error("Error processing request:" + ex.Message); } } protected override void OnLoad(EventArgs e) { try { if (!string.IsNullOrEmpty(Session["panelOpen"].ToString())) { lblPanelOpen.Text = string.Empty; Session.Remove("panelOpen"); } } catch (Exception ex) { Logger.Error("Unable to remove the session variable:" + ex.Message); } } In above code I am having a Session["panelOpen"] variable which is created from another user control and once my page is trying to render, I am storing Session["panelOpen"] in my hidden lblPanelOpen.Text on page OnInit() method, however when page is loaded completely then I am trying to remove the session variable. Please suggest!

    Read the article

  • javascript function call automatically on page onload instead on onclick

    - by user357134
    I am facing a very strange problem. I have javascript function in my aspx page that i call on the onclick event.but on one particular machine it always automatically called on body onload in infinite loop. Though I already remove all the caching and delte the history and temp files. This seems very strange to me .It works fine on all the machine excpt one. The machine have windows 7 and IE verison 8.0.7600.16385 Can some one please help me. Thanks in advance.

    Read the article

  • Appending target="_blank" to links in an iframe without using <body onload>

    - by CincauHangus
    I'm trying to change the links in an iframe to load in a new window instead of the iframe itself. Currently I use this code in head: $(document).ready(function() { var oIFrame = document.getElementById("iframeID"); var oDoc = (oIFrame.contentWindow || oIFrame.contentDocument); if(oDoc.document) oDoc = oDoc.document; var links = oDoc.getElementsByTagName("a"); for(var i=0; i<links.length; i++) { links[i].target="_blank"; } }); However, the code above is triggered before the iframe is fully loaded with its contents. I know this code would work if it's triggered in the body onload attribute, but I'd like to avoid that method and implement it in a function or a file instead.

    Read the article

  • How to set cursor focus onload?

    - by eswaramoorthy-nec
    Hi, I use h:selectOneRadio tag. I need to set the cursor focus to first radio field. <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h:form id="focusForm" > <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" /> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> </h:form> </body></html></f:view> here The Firefox (browser) assign id :focusForm:testRadioId:0 that field. So i use the following script: document.getElementById("focusForm:testRadioId:0").focus(); But, Some times, i may change dynamically disable the radio field from backing bean. <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" itemDisabled="true"/> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> So here i disable the first radio button. Now, If i use the same script, then not set cursor focus to first radio field. how to handle this? that means how to alter my script dynamically during onload? Please help me. Thanks in advance.

    Read the article

  • Filter Datagrid onLoad

    - by Morgan Delvanna
    My data grid successfully filters when I select a month from a dropdown list, however when I try to filter it onLoad it just doesn't filter. The dropdown successfully displays the current month, and the grid should also show the current month data. <script type="text/javascript"> dojo.require("dojox.grid.DataGrid"); dojo.require("dojox.data.XmlStore"); dojo.require("dijit.form.FilteringSelect"); dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dojo.date"); theMonth = new Date(); dojo.addOnLoad(function() { dojo.byId('monthInput').value = month_name[(theMonth.getMonth()+1)]; var filterString='{month: "' + theMonth.getMonth() + '"}'; var filterObject=eval('('+filterString+')'); dijit.byId("eventGrid").filter(filterObject); } ); var eventStore = new dojox.data.XmlStore({url: "events.xml", rootItem: "event", keyAttribute: "dateSort"}); function monthClick() { var ctr, test, rtrn; test = dojo.byId('monthInput').value; for (ctr=0;ctr<=11;ctr++) { if (test==month_name[ctr]) { rtrn = ctr; } } var filterString='{month: "' + rtrn + '"}'; var filterObject=eval('('+filterString+')'); eventGrid.setQuery(filterObject); } </script> </head> <body class="tundra"> <div id="header" dojoType="dijit.layout.ContentPane" region="top" class="pfga"></div> <div id="menu" dojoType="dijit.layout.ContentPane" region="left" class="pfga"></div> <div id="content" style="width:750px; overflow:visible" dojoType="dijit.layout.ContentPane" region="center" class="pfga"> <div dojotype="dojo.data.ItemFileReadStore" url="months.json" jsID="monthStore"></div> <div id="pagehead" class="Heading1" >Upcoming Events</div> <p> <input dojoType="dijit.form.FilteringSelect" store="monthStore" searchAttr="month" name="id" id="monthInput" class="pfga" onChange="monthClick()" /> </p> <table dojoType="dojox.grid.DataGrid" store="eventStore" class="pfga" style="height:500px; width:698px" clientSort="true" jsID="eventGrid"> <thead> <tr> <th field="date" width="80px">Date</th> <th field="description" width="600px">Description</th> </tr> <tr> <th field="time" colspan="2">Details</th> </tr> </thead> </table> </div> <div id="footer"></div>

    Read the article

  • body onload cache not clearing

    - by Mad Cow
    I'm using an image swapping function generated by Dreamweaver to allow an image to change when moused over. The images are small. I have a problem because the images are getting stored in cache and without clearing it out I cant get the new images to show. It works on some browsers, but unfortunately not on all... I've read about putting "a random query" into the javascript to force the page to reload, but I dont know where to put it (the code was generated for me by dreamweaver). A subset of my code is : <script type="text/javascript"> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('../images/navigation/social-about-us-over.jpg','../images/navigation/social-about-us.jpg','../images/navigation/social-activities-over.jpg','../images/navigation/social-ourservices-over.jpg','../images/navigation/social-howwework-over.jpg','../images/navigation/social-fundraising-over.jpg','../images/navigation/social-howtohelp-over.jpg','../images/navigation/social-contactus-over.jpg')"> My website is http://www.clockhouse.org.uk/ I'm sure there is a better way i could have written this, but if anyone can help me fix this code I'd be very grateful Many thanks

    Read the article

  • How to get scrollTop of page afer browser scrolled such page?

    - by Marco Demaio
    I know how to get the scrollTop of a page, I use this simple JS function (code copied around): function GetScrolledTop() { //I never work in IE quirkmode, I always use DOCTYPE as 1st line, so I don't need to test for document.body.scrollTop return self['pageYOffset'] || document.documentElement.scrollTop; } This works and my problem is the following: I tried to add it in the page onload event <body onload="alert(GetScrolledTop());"> On page load I get ZERO (which make sense), but the problem is that I get ZERO even if I scroll the page and then reload it without touching the scrollbar. It seems like the browser does: loads page calls my GetScrolledTop() (so obviously shows ZERO) then scrolls the page to where it was before. Do you know how to get the scolledTop after the step 3? I mean how to get the scrolledTop AFTER the browser scrolled the page? (maybe without using a timer) Thanks!

    Read the article

  • Using a bookmarklet to track a package

    - by user307558
    I'm trying to write a bookmarklet that tracks a package in the mail. First it checks to see if the tracking page is open, if not it opens it in a new tab, and then sets the value of the form to the tracking number. Finally, it submits the form. What I'm so far unable to do is set the value of the form in the case where the bookmarklet opens up a new tab. Here's what I have: javascript: (function(){ var trackingNumber = "/*tracking number*/"; var a = document.forms.trackingForm; if ('http://fedex.com/Tracking' == document.location) { trackingForm.trackNbrs.value = trackingNumber; document.forms.trackingForm.submit(); } else { window.open('http://fedex.com/Tracking'); this.window.onload = function(){ //This seems to be the problem trackingForm.trackNbrs.value = trackingNumber; onload(document.forms.trackingForm.submit()); } } })(); Any ideas?

    Read the article

  • Checking for multiple images loaded

    - by Stanni
    Hi, I'm using the canvas feature of html5. I've got some images to draw on the canvas and I need to check that they have all loaded before I can use them. I have declared them inside an array, I need a way of checking if they have all loaded at the same time but I am not sure how to do this. Here is my code: var color = new Array(); color[0] = new Image(); color[0].src = "green.png"; color[1] = new Image(); color[1].src = "blue.png"; Currently to check if the images have loaded, I would have to do it one by one like so: color[0].onload = function(){ //code here } color[1].onload = function(){ //code here } If I had a lot more images, Which I will later in in development, This would be a really inefficient way of checking them all. How would I check them all at the same time?

    Read the article

  • [JavaScript] Checking for multiple images loaded.

    - by Stanni
    Hi, I'm using the canvas feature of html5. I've got some images to draw on the canvas and I need to check that they have all loaded before I can use them. I have declared them inside an array, I need a way of checking if they have all loaded at the same time but I am not sure how to do this. Here is my code: var color = new Array(); color[0] = new Image(); color[0].src = "green.png"; color[1] = new Image(); color[1].src = "blue.png"; Currently to check if the images have loaded, I would have to do it one by one like so: color[0].onload = function(){ //code here } color[1].onload = function(){ //code here } If I had a lot more images, Which I will later in in development, This would be a really inefficient way of checking them all. How would I check them all at the same time?

    Read the article

  • [BEGINNER] Javascript Pop Ups

    - by user566312
    Hey All, My boss has asked for a page that will not change to have two timed pop ups load. I have found code and edited it to what I had thought it should do, but it is only loading the last onLoad event. I am a designer and I have helped with making webpages, but Javascript is so far outside of what I can understand. I have already learned how to use the single pop up and spent a whiiile learning the timeouts, but I cannot seem to get it to work with multiple popup functions. If you have a moment, would you take a look? Thank you :) h <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>H's Page 1</title> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Ronnie T. Moore, Editor --> <!-- Web Site: The JavaScript Source --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin closetime = 3; // Close window after __ number of seconds? // 0 = do not close, anything else = number of seconds function Start1(URL, WIDTH, HEIGHT) { windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT; preview = window.open(URL, "preview", windowprops); if (closetime) setTimeout("preview.close();", closetime*1000); } function doPopup1() { url = "http://www.google.com"; width = 1680; // width of window in pixels height = 1050; // height of window in pixels delay = 10; // time in seconds before popup opens timer = setTimeout("Start1(url, width, height)", delay*1000); } closetime = 3; // Close window after __ number of seconds? function Start2(URL, WIDTH, HEIGHT) { windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT; preview = window.open(URL, "preview", windowprops); if (closetime) setTimeout("preview.close();", closetime*1000); } function doPopup2() { url = "http://www.yahoo.com"; width = 1680; // width of window in pixels height = 1050; // height of window in pixels delay = 5; // time in seconds before popup opens timer = setTimeout("Start2(url, width, height)", delay*1000); } // End --> </script> <!-- STEP TWO: Insert the onLoad event handler into your BODY tag --> <!-- Script Size: 1.27 KB --> </head> <body OnLoad="doPopup1(); doPopup2();"> <p>My page text.</p> <p>My page text.</p> <p>My page text.</p> <p>My page text.</p> </body> </html>

    Read the article

  • Delaying execution of Javascript function relative to Google Maps / geoxml3 parser?

    - by Terra Fimeira
    I'm working on a implementing a Google map on a website with our own tiles overlays and KML elements. I've been previously requested to create code so that, for instance, when the page is loaded from a specific URL, it would initialize with one of the tile overlays already enabled. Recently, I've been requested to do the same for the buildings which are outlined by KML elements so that, arriving at the page with a specific URL, it would automatically zoom, center, and display information on the building. However, while starting with the tile overlays work, the building KML does not. After doing some testing, I've determined that when the code which checks the URL executes, the page is still loading the KML elements and thus do not exist for the code to compare to or use: Code for evaluating URL (placed at the end of onLoad="initialize()") function urlClick() { var currentURL = window.location.href; //Retrieve page URL var URLpiece = currentURL.slice(-6); //pull the last 6 digits (for testing) if (URLpiece === "access") { //If the resulting string is "access": access_click(); //Display accessibility overlay } else if (URLpiece === "middle") { //Else if the string is "middle": facetClick('Middle College'); //Click on building "Middle College" }; }; facetClick(); function facetClick(name) { //Convert building name to building ID. for (var i = 0; i < active.placemarks.length; i++) { if (active.placemarks[i].name === name) { sideClick(i) //Click building whose id matches "Middle College" }; }; }; Firebug Console Error active is null for (var i = 0; i < active.placemarks.length; i++) { active.placemarks is which KML elements are loaded on the page, and being null, means no KML has been loaded yet. In short, I have a mistiming and I can't seem to find a suitable place to place the URL code to execute after the KMl has loaded. As noted above, I placed it at the end of onLoad="initialize()", but it would appear that, instead of waiting for the KML to completely load earlier in the function, the remainder of the function is executed: onLoad="initialize()" information(); //Use the buttons variables inital state to set up description buttons(); //and button state button_hover(0); //and button description to neutral. //Create and arrange the Google Map. //Create basic tile overlays. //Set up parser to work with KML elements. myParser = new geoXML3.parser({ //Parser: Takes KML and converts to JS. map: map, //Applies parsed KML to the map singleInfoWindow: true, afterParse: useTheData //Allows us to use the parsed KML in a function }); myParser.parse(['/maps/kml/shapes.kml','/maps/kml/shapes_hidden.kml']); google.maps.event.addListener(map, 'maptypeid_changed', function() { autoOverlay(); }); //Create other tile overlays to appear over KML elements. urlClick(); I suspect one my issues lies in using the geoxml3 parser (http://code.google.com/p/geoxml3/) which converts our KML files to Javascript. While the page has completed loading all of the elements, the map on the page is still loading, including the KML elements. I have also tried placing urlClick() in the parser itself in various places which appear to execute after all the shapes have been parsed, but I've had no success there either. While I've been intending to strip out the parser, I would like to know if there is any way of executing the "urlClick" after the parser has returned the KML shapes. Ideally, I don't want to use an arbitrary means of defining a time to wait, such as "wait 3 seconds, and go", as my various browsers all load the page at different times; rather, I'm looking for some way to say "when the parser is done, execute" or "when the Google map is completely loaded, execute" or perhaps even "hold until the parser is complete before advancing to urlClick".

    Read the article

  • Dojo addOnLoad, but is Dojo loaded?

    - by adamrice32
    I've encountered what seems like a chicken & egg problem, and have what I think is a logical solution. However, it occurred to me that others must have encountered something similar, so I figured I'd float it out there for the masses. The situation is that I want to use dojo's addOnLoad function to queue up a number of callbacks which should be executed after the DOM has completed rendering on the client side. So what I'm doing is as follows: <html> <head> <script type="text/javascript" src="dojo.xd.js"></script> ... </head> <body> ... <script type="text/javascript"> dojo.addOnLoad( ... ); dojo.addOnLoad( ... ); ... </script> </body> </html> Now, the issue is that I seem to be calling dojo.addOnLoad before the entire Dojo library has been downloaded the browser. This makes sense in a way, because the inline SCRIPT contents should be executed before the entire DOM is loaded (and the normal body onload callback is triggered). My question is this - is my approach sound, or would it make more sense to register a normal/standard body onload JavaScript callback to call a function, which does the same work that each of the dojo.addOnLoads is doing in the SCRIPT block. Of course, this begs the question, why would you ever then use dojo.addOnLoad if you're not guaranteed that the Dojo library will be loaded prior to using the library? Hopefully this situation makes sense to someone other than me. Seems like someone else may have encountered this situation. Thoughts? Best Regards, Adam Rice

    Read the article

  • XAML ComboBox SelectionChanged Fires OnLoad

    - by griegs
    If I have a ComboBox that has a SelectionChanged event, it fires when I'm loading the control. So at page load I set the SelectedValue and the SelectionChanged event fires which is not what I want to happen. What is the accepted apporach to stopping this?

    Read the article

  • Get a JQuery function to execute after and independently of onLoad

    - by lewicki
    Is is possible to execute a JQuery function by injecting it into the page? IT CAN'T be attached to the .ready function. The reason is that the user will be uploading an image via iframe. I need JCrop to execute after I display the uploaded image. echo "<script>$('#pictures_step1_right_bottom1', window.parent.document).html('<img id=\"cropbox\" src=\"../../box/" . 'THM' . $filenameAlt . '.jpg' . "\">');</script>"; echo "<script>jQuery(function(){jQuery('#cropbox').Jcrop();});</script>"; This is executed in the iframe that is processing the image. it then sends it to the main page. This does not work however. EDIT: Ended up running a timer: function checkPic() { if($('#cropbox1').length != 0) { jQuery(function() { jQuery('#cropbox1').Jcrop(); }); } timer(); // Check size again after 1 second } function timer(){ var myTimer = setTimeout('checkPic()', 3000); // Check size every 1 second}

    Read the article

  • Trouble with loading jquery onload.

    - by Darcy
    Hi guys, I'm trying to build some jquery tabs based on the request (which is stored in a table). I have two pages sharing one .js file. One page is for the user to create the request, and the other is for the administrator to approve/deny the request. On the admin page, here is my javascript code: $(function() { GetRequest(); }); Which is just calling a function I have inside my .js file. All the code in the .js file is also wrapped in a '$(function(){ //...code here })'. The problem is the function isn't built yet when calling it from the page. Is there a way I can tell the page to wait until the script is complete?

    Read the article

  • Event OnLoad on Telerik's grid (client selection)

    - by Kira
    Hi! I'm using Grid with "Client Selection" (http://demos.telerik.com/aspnet-mvc-beta/grid/selectionclientside) of Telerik, and my page loads with one of the lines already marked. I wonder how it could activate the event OnRowSelected (on the marked line) when the page loads. Thanks everyone!

    Read the article

  • html select execute javascript onload

    - by portoalet
    I am using HTML select onchange event to fire another javascript function func1. This html select is written into a form element, which are dynamically generated when users click on a button. The problem is how can I fire the javascript func1 when the dynamically generated form is first shown ? I am thinking of something along the line of on_first_show event for form ? Here is the snippet. I couldnt get the alert('don') to work either (the one just after div) var sPopupContents = "<div ><script type='text/javascript'>alert('don');</script> </div>"; // this javascript is not executed ? I cant get the alert. sPopupContents += "<form name='theform' >"; sPopupContents += "<select name='theselect' onchange='alert(2);"; sPopupContents += "func1()>'"; sPopupContents += "<option value='0' selected='selected'>Value1</option><option value='1'>Value2</option><br/>"; sPopupContents += "</form>";

    Read the article

  • How to reduce the lag time when using jquery to modify css onload

    - by Josh
    I have a jquery function that is called on $(document).ready that modifies the css of a Business Intelligence dashboard. I had to use jquery to make the adjustments because I do not have access to the source code of the BI tool. What happens is when the page loads, I run through the tab navigation and change the colors of the tabs based on certain requirements (which is basically dependent on the text of the tab). The issue I am facing is that there is a small lag time from when the page initially loads to when the jquery updates have been made to the page. Is there a way to reduce this lag time?

    Read the article

  • javascript will not work onload

    - by user2711818
    The javascript on the page needs to work onpage load. So I tried adding the document ready function into the code. It doesn't seem to work. http://janeucreative.com/daddychallenge/bag.html <script>$(document).ready(function() { function addItem(item) { var itemInCart = item.cloneNode(true); itemInCart.onclick = function() { removeItem(this); }; var cart = document.getElementById("cart"); cart.appendChild(itemInCart); } function removeItem(item) { var itemInItems = item.cloneNode(true); itemInItems.onclick = function() { addItem(this); }; var cart = document.getElementById("cart"); cart.removeChild(item); } init(); });</script> Any advice would be much appreciated! I'm very new to javascript and just trying to learn it a step at a time.

    Read the article

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