FAQ Database Discussion Community


Meteor JS - showing DOM elements on specific templates

javascript,meteor,onload
I do my first app with meteor js and I need suggestions about showing elements on specific templates. I have header which stays for all templates and content div where templates switches with iron router. I have two buttons on header which wont be shown on some template so I...

MS CRM 2011 IFRAME “load” event not fired

jquery,iframe,dynamics-crm-2011,dynamics-crm,onload
I have MS CRM 2011 (5.0.9690.2243, on demand) HTML web resource which loads entity inside IFRAME: <HTML> <HEAD> <SCRIPT type=text/javascript src="http://code.jquery.com/jquery-latest.min.js"></SCRIPT> <SCRIPT> $(document).ready(function(){ if (window.console) console.log('doc ready'); var f=$("#m4_ifr_entity"); f.bind('load', function() { if (window.console) console.log('iframe loaded'); // do some stuff here }); }); </SCRIPT> <META charset=utf-8> </HEAD> <BODY contentEditable=true> <DIV...

javascript click button after be shure that page has completely loaded

javascript,button,window,document,onload
I have the website example.com and on this website is a button with the id "button1" and by clicking on this button, it opens an unknown url "example.com/unknownUrl" with the known button "buttonOnUnknownPage" on it. How can i be sure that the unknown page has finished loading and i can...

Replace paragraph in HTML with new paragraph using Javascript

javascript,function,onload,getelementbyid,appendchild
I am attempting to replace a p in my HTML doc with a paragraph created in Javascript. Once the page loads, two will be replaced with t. var two = document.getElementById("two"); document.onload = function myFunction() { var p = document.createElement("p"); var t = document.createTextNode("I am the superior text"); p.appendChild(t); document.getElementById("p");...

Javascript or Jquery: Write html to iframe not fire $(document).ready in IE

javascript,jquery,iframe,onload,ready
This is my situation. The main page: <script type="text/javascript"> function load_frm() { if($.browser.msie == true) { var frame = document.getElementById('frm'); frame.contentWindow.document.write(patch_html); } else { $("#frm").attr('src', "data:text/html;charset=utf-8," + escape(patch_html)); } } </script> <html> <body> <input type="button" onclick="load_frm()"> <iframe id="frm"></iframe> </body> </html> the patch_html contain $(document).ready which is need to fire after...

XUL event listener for page load (in current tab only) or tab switch

xul,onload
Is there a simple script which will allow me to be notified if the a page is loaded in the current tab or if a new tab is now in focus?

How to get my javascript function to display on page load

javascript,function,onload,countdown
I have found the following script that I would like to edit and use, however i cannot seem to find out how to make the script run and display when a webpage is loaded. http://jsfiddle.net/8Ab78/4/ function ShowTime() { var now = new Date(); var hrs = 18-now.getHours(); var mins =...

How can I check if HTML content is called by AJAX request?

jquery,html,ajax,onload
Here is the HTML content of a mosaic of images. <div id="container"> <img id="1" /> ... <img id="20" /> </div> This script is creating a mosaic from the images after page has been loaded or resized. <script> function create_mosaic(){ /*creates mosaic by resizing and arranging images in container*/ } jQuery(window).load(function()...

How can one animate position using CSS -webkit-animation

javascript,html,css,onload,transitions
I want to make an image go from poitn a to point b. I can animate the blur, and scale smoothly but the position is not working. It doesn't flow as it should. I have tried it with translatex and translate y and it doesn't seem to respond. Can someone...

Meteor - trigger window resize on document load

meteor,resize,onload
I'm newbie in Meteor looking for jQuery alternative of $(window).load(function(){ $(window).resize(function(){ // do stuff }); }); I'm wordering what is the right way to do this in Meteor?...

Why js function does not change the html code permanently?

javascript,html,forms,onclick,onload
In the body of the HTML page is a button that calls the Javascript function from an onclick event, and in the head is the Javascript function that I would like to run with more permanent results. <!Doctype html> <html lang="fr"> <head> <meta charset="utf-8"/> <script type="text/javascript" language="javascript"> function loadformTest(){ document.getElementById('departement').value...

resize function only works in one dimension

javascript,onload,onresize
I have a resize function that keeps the main div resized in a consistent ratio. I originally had it resizing according to window width which worked fine (the 1st condition in the function). Then I added a second condition so that if the window is too short it resizes according...

Convert Window Onload function to non blocking

javascript,jquery,onload,onload-event
can anyone help me to convert this following function so that it wont block the page loading. I read that $(window).load function is bad but I'm using FlexiSlider which uses $(window).load. I have no idea how to outrun this. Here is the code: (function ($) { $(window).load(function() { $('.flexslider').flexslider(); });...

Fire off an event when async javascript is loaded

javascript,events,asynchronous,onload
I'm changing my external javascript resources to be loaded asynchronously to speed up page load. To do this, I'm adding the async property to my script tags: <script async type="text/javascript" src="external.js"></script> Right before the end of the body tag I have included this code to perform callbacks: if (typeof(myFuncion) ===...

Canvas background image is on top of second drawn image

javascript,html,canvas,onload
I have a background image set in my canvas; it's a map. I then want to "draw" red pin images on various points on top of the map. Right now in Chrome, the first pin I have "drawn" with the context, is coming up underneath the background map. I am...

How to fadeout borders and bgcolour of a div after some time of pageload?

jquery,css,onload,fadeout
i want to show this div "abc" on page load. at that time suppose background colour will be yellow. and borders will be black. but after few seconds there will be only the text. no borders and bgcolour. <script> $(window).load(function(){ setTimeout(function(){ $('#abc').fadeIn(); $('#abc').fadeOut(); },1000); }); </script> <div id="abc" style="background-color:#FFFF99; border:1px;...

return value calculated from javascript FileReader onload event

javascript,callback,onload,filereader
I have this function: function doStuff(range, file) { var fr = new FileReader(); var hash = ''; fr.onload = function (e) { var out = "stuff happens here"; hash = asmCrypto.SHA256.hex(out); return hash; }; fr.readAsArrayBuffer(file); return hash; } Right now, the function completes before the onload event is finished, so...

Load code without using a button

javascript,html,onload
I am trying to change this code so that it no longer needs a button to tell me which browser I am using. I want it to pop up when the page loads instead of being on a button. If someone can show me the changes needed that would be...

How to refresh only a image of a whole page, when the imagename is variabel?

image,load,refresh,onload
This is my puzzle i'm struggeling with: I have a website with a certain amount of images, and i'd like the images to be refreshed each say 20 seconds, this is the code I wrote so far for that: <IMG src="imgcam/mostasquare_1.jpg" border="1" name="refresh" id="img1"> <IMG src="imgcam/mriehelbypass_1.jpg" border="1" name="refresh" id="img2"> <SCRIPT...