JavaScript jQuery - appended script executed after all page loaded jquery append script tag,jquery append script to page,jquery

I'm currently working on a page that have one iframe and one script adding a menu bar.

The iframe have a script which is long to load, and the other script for the menu have to be add dynamically like this:

jQuery(document).ready(function () {
    var script = document.createElement('script');

    var url = 'URL TO SCRIPT THAT ADD MENU BAR';
    script.type = 'text/javascript';
    script.src = url;
    jQuery("head").append(script);

});

After testing it seems that this code is executed but Chrome wait for the iframe to be completely loaded so the bar appears after few seconds when the iframe page has finished loading.

So is there a way to execute the script appended before the script in the iframe?

Thanks :)

Answer:1

I am a first poster here so please excuse my noob-like behavior. I have a button on my website that when pressed should disappear, and a form should be echoed out in its place without a page refresh....

I am a first poster here so please excuse my noob-like behavior. I have a button on my website that when pressed should disappear, and a form should be echoed out in its place without a page refresh....

  1. make button appear on hover
  2. make button appear as link
  3. make button appear javascript
  4. make button appear unity
  5. make button appear at bottom of div
  6. make button appear clickable
  7. make button appear vba

For a project I need to use two radio buttons in a group, and need to uncheck the radio button that is checked, on click. I have tried something like this, but this doesn't work: $(document).ready(...

For a project I need to use two radio buttons in a group, and need to uncheck the radio button that is checked, on click. I have tried something like this, but this doesn't work: $(document).ready(...

I have a .ascx page where I have to display a map. <img width="550" height="296" usemap="#Map" alt="" src="~/map_international.jpg"> <map name="Map"> <area shape="poly" coords="230,...

I have a .ascx page where I have to display a map. <img width="550" height="296" usemap="#Map" alt="" src="~/map_international.jpg"> <map name="Map"> <area shape="poly" coords="230,...

  1. passing data with href

I am trying to replace the document.write() function in Javascript. Not completely sure how to do, as I don't know which element to write the HTML to. Currently, the code javascript code is inserted ...

I am trying to replace the document.write() function in Javascript. Not completely sure how to do, as I don't know which element to write the HTML to. Currently, the code javascript code is inserted ...

  1. replacing document.write